// 每周总活跃
import { readFileAndParse, parseGoodStr } from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';

export interface DicGuildActiveWeekReward {

    // id
    readonly id: number;
    // 周最低点数
    readonly rankMin: number;
    // 周最高点数
    readonly rankMax: number;
    // 奖励
    readonly reward: RewardInter[];

}

export const dicGuildActiveWeekReward = new Array<DicGuildActiveWeekReward>();
export function loadGuildActiveWeekReward() {
    dicGuildActiveWeekReward.splice(0, dicGuildActiveWeekReward.length);
    let arr = readFileAndParse(FILENAME.DIC_ACTIVE_WEEK_REWARD);

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