feat(玉石一键合成): 新增玉石一键合成

This commit is contained in:
zhangxk
2023-07-13 19:31:41 +08:00
committed by luying
parent 9c10f33401
commit fc440afe83
7 changed files with 237 additions and 9 deletions

View File

@@ -10,8 +10,8 @@ export interface DicStone {
readonly name: string;
// 装备栏id
readonly eplaceId: number;
// itid
readonly itid: number;
// itId
readonly itId: number;
// 地玉石阶
readonly lv: number;
// 地玉石品质
@@ -24,8 +24,12 @@ export interface DicStone {
export const dicStone = new Map<number, DicStone>();
export const dicStoneItId = new Map<number, DicStone[]>();
export const dicStoneItIdLv = new Map<string, number>();
export function loadStone() {
dicStone.clear();
dicStoneItId.clear();
dicStoneItIdLv.clear();
let arr = readFileAndParse(FILENAME.DIC_STONE);
@@ -33,6 +37,14 @@ export function loadStone() {
o.composeMaterial = parseGoodStr(o.composeMaterial);
o.attribute = parseAttr(o.attribute);
dicStone.set(o.good_id, o);
if (!dicStoneItId.has(o.itId)) {
dicStoneItId.set(o.itId, new Array<DicStone>());
}
dicStoneItId.get(o.itId).push(o);
dicStoneItIdLv.set(`${o.itId}_${o.lv}`, o.good_id);
});
arr = undefined;
}