// 藏宝图合成表
import { readFileAndParse, parseGoodStr } from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';

export interface DicBlueprtCompose {

    // 品质
    readonly quality: number;
    // 消耗的寻宝币数量
    readonly coinNum: RewardInter[];
    // 消耗的藏宝图的数量
    readonly blueprtNum: number;
    // 目标品质
    readonly targetQuality: number;

}

export const dicBlueprtCompose = new Map<number, DicBlueprtCompose>();
export function loadBlueprtCompose() {
    dicBlueprtCompose.clear();
    let arr = readFileAndParse(FILENAME.DIC_BLUEPRT_COMPOSE);

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