主线:添加warType

This commit is contained in:
luying
2022-03-14 17:08:36 +08:00
parent 992885674e
commit 7b4f500979
4 changed files with 53 additions and 48 deletions

View File

@@ -12,10 +12,12 @@ export interface DicMainStarBox {
readonly star: number;
// 奖励
readonly reward: RewardInter[];
// 主线类型
readonly warType: number;
}
export const dicMainStarBox = new Map<number, DicMainStarBox>();
export const dicMainStarBoxByChapter = new Map<number, number[]>(); // chapter => ids;
export const dicMainStarBoxByChapter = new Map<string, number[]>(); // chapter => ids;
export function loadMainStarBox() {
dicMainStarBox.clear();
dicMainStarBoxByChapter.clear();
@@ -24,11 +26,12 @@ export function loadMainStarBox() {
arr.forEach(o => {
o.reward = parseGoodStr(o.reward);
o.warType = o.maintype;
dicMainStarBox.set(o.id, o);
if(!dicMainStarBoxByChapter.has(o.chapter)) {
dicMainStarBoxByChapter.set(o.chapter, []);
if(!dicMainStarBoxByChapter.has(`${o.warType}_${o.chapter}`)) {
dicMainStarBoxByChapter.set(`${o.warType}_${o.chapter}`, []);
}
dicMainStarBoxByChapter.get(o.chapter).push(o.id);
dicMainStarBoxByChapter.get(`${o.warType}_${o.chapter}`).push(o.id);
});
arr = undefined;
}