// 每日个人可领奖励
import { readFileAndParse, parseGoodStr } from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';

export interface DicGuildActiveDayReward {

    // id
    readonly id: number;
    // 权限
    readonly activeDayPoint: number;
    // 奖励
    readonly reward: RewardInter[];

}

export const dicGuildActiveDayReward = new Map<number, DicGuildActiveDayReward>();
export function loadGuildActiveDayReward() {
    dicGuildActiveDayReward.clear();
    
    let arr = readFileAndParse(FILENAME.DIC_ACTIVE_DAY_REWARD);

    arr.forEach(o => {
        o.reward = parseGoodStr(o.Reward)
        dicGuildActiveDayReward.set(o.id, o);
    });
    arr = undefined;
}