// 天晶石表
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts';

export interface DicJewelCondition {
    // id
    readonly id: number;
    // 天晶石品质
    readonly jewelLv: number;
    // 属性词条id
    readonly randSeId: number;
    // 需要的地玉石的数量
    readonly stoneCnt: number;
    // 需要的地玉石的品质之和
    readonly stoneLv: number;
}


export const dicJewelCondition = new Map<string, DicJewelCondition>();
export function loadJewelCondition() {
    dicJewelCondition.clear();
    
    let arr = readFileAndParse(FILENAME.DIC_JEWEL_CONDITION);

    arr.forEach(o => {
        dicJewelCondition.set(`${o.jewelLv}_${o.randSeId}`, o);
    });
    arr = undefined;
}