// 武将技能表
import {parseGoodStr, readFileAndParse} from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';

export interface DicHeroQualityUp {

    // id
    readonly id: number;
    // 品质
    readonly quality: number;
    // 碎片数量
    readonly fragmentNum: number;
    // 消耗道具
    readonly consume: Array<RewardInter>;

}

export const dicHeroQualityUp = new Map<number, DicHeroQualityUp>();
export function loadHeroQualityUp() {
    dicHeroQualityUp.clear();
    let arr = readFileAndParse(FILENAME.DIC_HERO_QUALITY_UP);

    arr.forEach(o => {
        o.consume = parseGoodStr(o.consume);
        dicHeroQualityUp.set(o.quality, o);
    });
    arr = undefined;
}
