主线:添加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;
}

View File

@@ -172,167 +172,167 @@
"chapter": 1,
"star": 6,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 26,
"chapter": 1,
"star": 12,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 27,
"chapter": 1,
"star": 18,
"reward": "22001&30",
"maintype": 2
"maintype": 12
},
{
"id": 28,
"chapter": 2,
"star": 6,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 29,
"chapter": 2,
"star": 12,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 30,
"chapter": 2,
"star": 18,
"reward": "22001&30",
"maintype": 2
"maintype": 12
},
{
"id": 31,
"chapter": 3,
"star": 6,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 32,
"chapter": 3,
"star": 12,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 33,
"chapter": 3,
"star": 18,
"reward": "22001&30",
"maintype": 2
"maintype": 12
},
{
"id": 34,
"chapter": 4,
"star": 6,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 35,
"chapter": 4,
"star": 12,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 36,
"chapter": 4,
"star": 18,
"reward": "22001&30",
"maintype": 2
"maintype": 12
},
{
"id": 37,
"chapter": 5,
"star": 7,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 38,
"chapter": 5,
"star": 14,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 39,
"chapter": 5,
"star": 21,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 40,
"chapter": 5,
"star": 28,
"reward": "22001&30",
"maintype": 2
"maintype": 12
},
{
"id": 41,
"chapter": 6,
"star": 7,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 42,
"chapter": 6,
"star": 14,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 43,
"chapter": 6,
"star": 21,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 44,
"chapter": 6,
"star": 28,
"reward": "22001&30",
"maintype": 2
"maintype": 12
},
{
"id": 45,
"chapter": 7,
"star": 7,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 46,
"chapter": 7,
"star": 14,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 47,
"chapter": 7,
"star": 21,
"reward": "31002&500",
"maintype": 2
"maintype": 12
},
{
"id": 48,
"chapter": 7,
"star": 28,
"reward": "22001&30",
"maintype": 2
"maintype": 12
}
]