Files
ZYZ/shared/pubUtils/dictionary/DicRougeScoreReward.ts
2023-09-08 21:25:39 +08:00

28 lines
916 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 随机事件图鉴
*/
import { parseGoodStr, readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';
export interface DicRougeScoreReward {
readonly index: number;
readonly score: number; // 积分
readonly reward: RewardInter[]; // 图鉴收集奖励同Group只领取一次奖励
readonly level: number; // 难度等级
}
export const dicRougeScoreRewardByLv = new Map<number, Map<number, DicRougeScoreReward>>();
export function loadRougeScoreReward() {
dicRougeScoreRewardByLv.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_SCORE_REWARD);
arr.forEach(o => {
o.reward = parseGoodStr(o.reward);
if (!dicRougeScoreRewardByLv.has(o.level)) dicRougeScoreRewardByLv.set(o.level, new Map);
dicRougeScoreRewardByLv.get(o.level).set(o.index, o);
});
arr = undefined;
}