边窗:主线关卡奖励

This commit is contained in:
luying
2022-06-27 20:17:16 +08:00
parent 2e03348f53
commit eb4ecd7c94
8 changed files with 709 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
// 主线星级宝箱
import {readFileAndParse, parseGoodStr} from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';
export interface DicMainWarReward {
// id
readonly id: number;
// 章节id
readonly chapter: number;
// 主线类型
readonly warType: number;
// 关卡id
readonly warId: number;
// 奖励
readonly cityReward: RewardInter[];
}
export const dicMainWarRewardByChapter = new Map<string, DicMainWarReward[]>(); // chapter => ids;
export function loadMainWarReward() {
dicMainWarRewardByChapter.clear();
let arr = readFileAndParse(FILENAME.DIC_MAIN_WAR_REWARD);
arr.forEach(o => {
o.cityReward = parseGoodStr(o.cityReward);
if(!dicMainWarRewardByChapter.has(`${o.warType}_${o.chapter}`)) {
dicMainWarRewardByChapter.set(`${o.warType}_${o.chapter}`, []);
}
dicMainWarRewardByChapter.get(`${o.warType}_${o.chapter}`)?.push(o);
});
arr = undefined;
}