Files
ZYZ/shared/pubUtils/dictionary/DicKingExp.ts

24 lines
561 B
TypeScript

// 主公经验
import {readJsonFile} from '../util'
import { FILENAME } from '../../consts'
export interface DicKingExp {
// 等级
readonly level: number;
// 经验
readonly exp: number;
}
const str = readJsonFile(FILENAME.DIC_KING_EXP);
let arr = JSON.parse(str);
export const dicKingExp = new Map<number, {sum: number, cur: number}>();
export let maxPlayerLv = 0;
let exp = 0;
arr.forEach(o => {
exp += o.exp;
if(o.level > maxPlayerLv) maxPlayerLv = o.level;
dicKingExp.set(o.level, { sum: exp, cur: o.exp });
});
arr = null;