Files
ZYZ/shared/pubUtils/dictionary/DicRougeScoreReward.ts
2023-08-30 11:02:52 +08:00

27 lines
810 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只领取一次奖励
}
export const dicRougeScoreReward = new Map<number, DicRougeScoreReward>();
export const dicRougeScoreNum = { num: 0 }
export function loadRougeScoreReward() {
dicRougeScoreReward.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_SCORE_REWARD);
arr.forEach(o => {
o.reward = parseGoodStr(o.reward);
dicRougeScoreReward.set(o.index, o);
dicRougeScoreNum.num++;
});
arr = undefined;
}