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