// 武将特技表
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'

export interface DicRandomEffectPoolPlan {
    // 方案id
    readonly planId: number;
    // 值
    readonly num: number;
    // 权重
    readonly weight: number;
}

export const dicRandomEffectPoolPlan = new Map<number, DicRandomEffectPoolPlan[]>(); // planId => [{num,weight}]
export function loadRandomEffectPoolPlan() {
    dicRandomEffectPoolPlan.clear();
    
    let arr = readFileAndParse(FILENAME.DIC_RANDOM_EFFECT_POOL_PLAN);

    arr.forEach(o => {
        if(!dicRandomEffectPoolPlan.has(o.planId)) {
            dicRandomEffectPoolPlan.set(o.planId, []);
        }
        dicRandomEffectPoolPlan.get(o.planId).push(o);
    });
    arr = undefined;
}