后台: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
@@ -1,5 +1,5 @@
// 武将羁绊好感等级表
import { readJsonFile } from '../util';
import { readFileAndParse } from '../util';
import { FILENAME } from '../../consts';
export interface DicFriendShipLevel {
@@ -13,15 +13,17 @@ export interface DicFriendShipLevel {
readonly expSum: number;
}
const str = readJsonFile(FILENAME.DIC_FRIEND_SHIP_LEVEL);
let arr = JSON.parse(str);
export let maxFriendShipLv = 0;
export const dicFriendShipLevelMap = new Map<number, DicFriendShipLevel>();
let expSum = 0;
arr.forEach(o => {
expSum += o.exp;
o.expSum = expSum;
dicFriendShipLevelMap.set(o.level, o);
if(o.level > maxFriendShipLv) maxFriendShipLv = o.level;
});
export function loadFriendShipLevel() {
let arr = readFileAndParse(FILENAME.DIC_FRIEND_SHIP_LEVEL);
let expSum = 0;
arr.forEach(o => {
expSum += o.exp;
o.expSum = expSum;
dicFriendShipLevelMap.set(o.level, o);
if(o.level > maxFriendShipLv) maxFriendShipLv = o.level;
});
arr = undefined;
}