// GVG城池
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';
import { parseGoodStr, readFileAndParse } from '../util'

export interface DicGVGCityAdd {
    // 城池类型 1-大城 2-中城 3-小城
    readonly cityType: number;
    // 粮食加成
    readonly foodAdd: number;
    // 矿物加成
    readonly mineralAdd: number;
    // 木头加成
    readonly woodAdd: number;
    // 占领积分
    readonly occupyReward: RewardInter[];
}

export const dicGVGCityAdd = new Map<number, DicGVGCityAdd>();
export function loadGVGCityAdd() {
    dicGVGCityAdd.clear();
    
    let arr = readFileAndParse(FILENAME.DIC_GVG_CITY_ADD);
    arr.forEach(o => {
        o.occupyReward = parseGoodStr(o.occupyReward);
        dicGVGCityAdd.set(o.cityType, o);
    });
    arr = undefined;
}