✨ feat(gvg): 添加激战期排行榜奖励资源
This commit is contained in:
30
shared/pubUtils/dictionary/DicGVGBattleRankReward.ts
Normal file
30
shared/pubUtils/dictionary/DicGVGBattleRankReward.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
// GVG城池
|
||||
import { FILENAME } from '../../consts'
|
||||
import { RewardInter } from '../interface';
|
||||
import { parseGoodStr, readFileAndParse } from '../util'
|
||||
|
||||
export interface DicGVGBattleRankReward {
|
||||
// 排行榜类型
|
||||
readonly type: number;
|
||||
// 最小排名
|
||||
readonly min: number;
|
||||
// 最大排名
|
||||
readonly max: number;
|
||||
// 奖励
|
||||
readonly reward: RewardInter[];
|
||||
}
|
||||
|
||||
export const dicGVGBattleRankReward = new Map<number, DicGVGBattleRankReward[]>(); // type => DicGVGBattleRankReward[]
|
||||
export function loadGVGBattleRankReward() {
|
||||
dicGVGBattleRankReward.clear();
|
||||
|
||||
let arr = readFileAndParse(FILENAME.DIC_GVG_BATTLE_RANK_REWARD);
|
||||
arr.forEach(o => {
|
||||
if(!dicGVGBattleRankReward.has(o.type)) {
|
||||
dicGVGBattleRankReward.set(o.type, []);
|
||||
}
|
||||
o.reward = parseGoodStr(o.reward);
|
||||
dicGVGBattleRankReward.get(o.type)?.push(o);
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user