25 lines
625 B
TypeScript
25 lines
625 B
TypeScript
// 主公经验
|
|
import {readFileAndParse} from '../util'
|
|
import { FILENAME } from '../../consts'
|
|
|
|
export interface DicKingExp {
|
|
// 等级
|
|
readonly level: number;
|
|
// 经验
|
|
readonly exp: number;
|
|
}
|
|
|
|
export const dicKingExp = new Map<number, {sum: number, cur: number}>();
|
|
export const maxPlayerLv = { max: 0 };
|
|
|
|
export function loadKingExp() {
|
|
|
|
let arr = readFileAndParse(FILENAME.DIC_KING_EXP);
|
|
let exp = 0;
|
|
arr.forEach(o => {
|
|
exp += o.exp;
|
|
if(o.level > maxPlayerLv.max) maxPlayerLv.max = o.level;
|
|
dicKingExp.set(o.level, { sum: exp, cur: o.exp });
|
|
});
|
|
arr = null;
|
|
} |