添加字典表解析
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
// 武将特技表
|
||||
import { readJsonFile, parseNumberList } from '../util'
|
||||
import { FILENAME } from '../../consts/consts'
|
||||
|
||||
export interface DicSe {
|
||||
|
||||
// 特技id
|
||||
readonly id: number;
|
||||
// 特技名
|
||||
readonly name: string;
|
||||
// 类型
|
||||
readonly type: number;
|
||||
// 是否显示
|
||||
readonly isShow: number;
|
||||
// 包含的值
|
||||
readonly gainValueArr: Array<number>;
|
||||
// 最大触发数
|
||||
readonly maxOnlyNum: number;
|
||||
}
|
||||
|
||||
|
||||
const str = readJsonFile(FILENAME.DIC_SE);
|
||||
let arr = JSON.parse(str);
|
||||
|
||||
export const dicSe = new Map<number, DicSe>();
|
||||
|
||||
arr.forEach(o => {
|
||||
o.gainValueArr = parseNumberList(o.gainvalue)
|
||||
dicSe.set(o.id, o);
|
||||
});
|
||||
Reference in New Issue
Block a user