后台: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
+9 -8
View File
@@ -1,5 +1,5 @@
// pvp三个对手
import {readJsonFile} from '../util'
import {readFileAndParse} from '../util'
import { FILENAME } from '../../consts'
export interface DicPvpOpponent {
@@ -15,13 +15,14 @@ export interface DicPvpOpponent {
readonly ratio: number;
}
const str = readJsonFile(FILENAME.DIC_PVP_OPPONENT);
let arr = JSON.parse(str);
export const dicPvpOpponent = new Map<number, DicPvpOpponent>();
export function loadPvpOpponent() {
arr.forEach(o => {
dicPvpOpponent.set(o.id, o);
});
let arr = readFileAndParse(FILENAME.DIC_PVP_OPPONENT);
arr = undefined;
arr.forEach(o => {
dicPvpOpponent.set(o.id, o);
});
arr = undefined;
}