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

export interface DicRefine {

    // 精炼id
    readonly id: number;
    // 精炼等级
    readonly level: number;
    // 提高属性百分比
    readonly upPercent: number;
    // 材料
    readonly material: Array<RewardInter>;
    // 成功率
    readonly successRate: number;

}

export const dicRefine = new Map<number, DicRefine>();
export function loadRefine() {

    let arr = readFileAndParse(FILENAME.DIC_REFINE);

    arr.forEach(o => {
        o.material = parseGoodStr(o.material)
        dicRefine.set(o.level, o);
    });
    
    arr = undefined;
}