This commit is contained in:
mamengke01
2020-12-24 10:06:12 +08:00
parent 50e1e98daf
commit cc1a91ed09
5 changed files with 175 additions and 89 deletions

View File

@@ -54,7 +54,8 @@ export interface DicGoods {
readonly count?: number;
readonly nextJewelId?: number;
readonly specialCount?: number;
readonly nextSpecialId?: number;
}
const str = readJsonFile(FILENAME.DIC_GOODS);
@@ -83,6 +84,8 @@ const DicGoodsKeys: KeysEnum<DicGoods> = {
pieceId: true,
count: true,
nextJewelId: true,
specialCount: true,
nextSpecialId: true
}
export const dicJewel = new Map<number, DicGoods>();
export const dicGoods = new Map<number, DicGoods>();
@@ -108,8 +111,14 @@ arr.forEach(o => {
if (!!lastJewel) {
lastJewel.count = material.count;
lastJewel.nextJewelId = o.good_id;
if (!!o.specialMaterial.ids[0]) {
lastJewel.specialCount = o.specialMaterial.ids[0];
lastJewel.nextSpecialId = o.specialMaterial.count;
}
dicJewel.set(lastJewel.good_id, _.pick(lastJewel, Object.keys(DicGoodsKeys)));
}
} else {
dicJewel.set(o.good_id, _.pick(o, Object.keys(DicGoodsKeys)));
}
}
});