import { readFileAndParse, parseGoodStr } from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';
export interface DicPvpBox {

    readonly id: number;
    readonly score: number;
    readonly reward:  Array<RewardInter>;

}

export const dicPvpBoxs = new Array<DicPvpBox>();
export function loadPvpBox() {
    dicPvpBoxs.splice(0, dicPvpBoxs.length);
    let arr = readFileAndParse(FILENAME.DIC_PVP_BOX);

    arr.forEach(o => {
        o.reward = parseGoodStr(o.reward);
        dicPvpBoxs.push(o);
    });
    arr = undefined;
}
