Files
ZYZ/shared/pubUtils/dictionary/DicAuthorsBookGoodId.ts
2023-07-13 16:23:29 +08:00

29 lines
851 B
TypeScript

// 英灵对应的物品表
import { parseGoodStr, readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';
export interface DicAuthorsBookGoodId {
// id
readonly id: number;
// 对应物品表id
readonly goodId: number;
// 分解可得
readonly decomposeItem: RewardInter[];
// 英灵替换
readonly composeItem: RewardInter[];
}
export const dicAuthorsBookGoodId = new Map<number, DicAuthorsBookGoodId>();
export function loadAuthorsBookGoodId() {
dicAuthorsBookGoodId.clear();
let arr = readFileAndParse(FILENAME.DIC_AUTHORS_GOODID);
arr.forEach(o => {
o.decomposeItem = parseGoodStr(o.decomposeItem);
o.composeItem = parseGoodStr(o.composeItem)
dicAuthorsBookGoodId.set(o.goodId, o);
});
arr = undefined;
}