添加字典表解析

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
+26
View File
@@ -0,0 +1,26 @@
// 每日总表
import { readJsonFile, parseNumberList } from '../util'
import { FILENAME } from '../../consts/consts'
export interface DicDaily {
// 每日类型
readonly dailyType: number;
// 每日类型名称
readonly name: string;
// 每天可以挑战的次数
readonly timesPerDay: number;
// 每天可以购买的次数
readonly timesCanBuy: number;
// 难度
readonly difficultLvl: Array<number>;
}
const str = readJsonFile(FILENAME.DIC_DAILY);
let arr = JSON.parse(str);
export const dicDaily = new Array<DicDaily>();
arr.forEach(o => {
o.difficultLvl = parseNumberList(o.difficultLvl);
dicDaily.push(o);
});