后台:json上传

This commit is contained in:
luying
2021-05-12 18:56:47 +08:00
parent 2fc5017af8
commit 148a11edab
102 changed files with 1675 additions and 1117 deletions
+10 -9
View File
@@ -1,5 +1,5 @@
// 镇念塔表
import { decodeArrayListStr, readJsonFile, parseNumberList } from '../util'
import { decodeArrayListStr, readFileAndParse, parseNumberList } from '../util'
import { FILENAME } from '../../consts';
export interface DicSuit {
@@ -14,17 +14,18 @@ export interface DicSuit {
readonly tireInfo: Array<number>;
}
const str = readJsonFile(FILENAME.DIC_SUIT);
let arr = JSON.parse(str);
export const dicSuit = new Map<number, DicSuit>();
export function loadSuit() {
let arr = readFileAndParse(FILENAME.DIC_SUIT);
arr.forEach(o => {
o.effect = parseSuitEffect(o.effect);
o.tireInfo = parseNumberList(o.tireInfo);
dicSuit.set(o.id, o);
});
arr = undefined;
arr.forEach(o => {
o.effect = parseSuitEffect(o.effect);
o.tireInfo = parseNumberList(o.tireInfo);
dicSuit.set(o.id, o);
});
arr = undefined;
}
function parseSuitEffect(str: string) {
let result = new Array<{ count: number, seid: number }>();