// 诸侯混战军团排名奖励表
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'

export interface DicCityActivityReward {

    // 城池id
    readonly id: number;
    // 城池类型
    readonly type: number;
    // 军团排名最小排名
    readonly guildRankMin: number;
    // 军团排名最大排名
    readonly guildRankMax: number;
    // 军团内排名最小值
    readonly min: number;
    // 军团内排名最大值
    readonly max: number;
    // 可获得功勋
    readonly honour: number;
}

export const dicCityActivityReward = new Map<number, DicCityActivityReward[]>();
export function loadCityActivityReward() {
    dicCityActivityReward.clear();
    let arr = readFileAndParse(FILENAME.DIC_CITY_ACTIVITY_REWARD);
    
    arr.forEach(o => {
        if(dicCityActivityReward.has(o.type)) {
            dicCityActivityReward.get(o.type).push(o);
        } else {
            dicCityActivityReward.set(o.type, [o]);
        }
    });
    arr = undefined;
}