// 名将擂台每天22点排名奖励
import {parseGoodStr, readFileAndParse} from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';

export interface DicLadderRankReward {
    // id
    readonly id: number;
    // 最低排名
    readonly rankMin: number;
    // 最高排名
    readonly rankMax: number;
    // 突破奖励
    readonly reward: RewardInter[];
}

export const dicLadderRankReward: DicLadderRankReward[] = [];
export function loadLadderRankReward() {
    dicLadderRankReward.splice(0, dicLadderRankReward.length);
    
    let arr = readFileAndParse(FILENAME.DIC_LADDER_RANKREWARD);
    arr.forEach(o => {
        o.reward = parseGoodStr(o.reward)
        dicLadderRankReward.push(o);
    });
    arr = undefined;
}