添加字典表解析

This commit is contained in:
luying
2020-12-15 15:00:41 +08:00
parent 2a268b2158
commit 87cdd7a80f
33 changed files with 1462 additions and 47 deletions
+30
View File
@@ -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);
});