边窗:主线关卡奖励
This commit is contained in:
33
shared/pubUtils/dictionary/DicMainWarReward.ts
Normal file
33
shared/pubUtils/dictionary/DicMainWarReward.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user