后台:json上传
This commit is contained in:
@@ -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 }>();
|
||||
|
||||
Reference in New Issue
Block a user