// 主公经验
import {readFileAndParse} from '../util'
import { FILENAME } from '../../consts'

export interface DicCharExp {
    // 等级
    readonly level: number;
    // 经验
    readonly exp: number;
}

export const dicCharExp = new Map<number, number>();
export function loadCharExp() {
    dicCharExp.clear();
    let arr = readFileAndParse(FILENAME.DIC_CHAR_EXP);

    let exp = 0;
    arr.forEach(o => {
        exp += o.exp;
        dicCharExp.set(o.level, exp);
    });
    arr = undefined;
}