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

export interface DicSe {

    // 特技id
    readonly id: number;
    // 特技名
    readonly name: string;
    // 类型
    readonly type: number;
    // 是否显示
    readonly isShow: number;
    // 包含的值
    readonly gainValueArr: Array<number>;
    // 最大触发数
    readonly maxOnlyNum: number;
    // 随机值位置
    readonly index: number;
}

export const dicSe = new Map<number, DicSe>();
export function loadSe() {
    dicSe.clear();
    
    let arr = readFileAndParse(FILENAME.DIC_SE);

    arr.forEach(o => {
        o.index = 0;
        o.gainValueArr = parseNumberList(o.gainvalue)
        dicSe.set(o.id, o);
    });
    arr = undefined;
}