// 公会权限
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'

export interface DicGuildWishReward {

    // id
    readonly id: number;
    // itid
    readonly itid: number;
    // 品质
    readonly quality: number;
    // 功勋奖励
    readonly honourReward: number;

}

export const dicGuildWishReward = new Map<string, DicGuildWishReward>();
export function loadGuildWishReward() {
    dicGuildWishReward.clear();
    let arr = readFileAndParse(FILENAME.DIC_GUILD_WISH_REWARD);

    arr.forEach(o => {
        if(o.starLevel == '&') o.starLevel = 0;
        dicGuildWishReward.set(`${o.itid}_${o.quality}`, o);
    });
    arr = undefined;
}