字典表筛选字段,修改FILENAME位置
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
// 物品表
|
||||
import {decodeArrayListStr, readJsonFile, parseReward} from '../util'
|
||||
import { FILENAME, IT_TYPE } from '../../consts/consts'
|
||||
import { FILENAME, IT_TYPE, ABI_TYPE } from '../../consts'
|
||||
import { RewardInter } from '../interface';
|
||||
import { ABI_TYPE } from '../../consts';
|
||||
const _ = require('lodash');
|
||||
|
||||
export interface DicGoods {
|
||||
// 物品id
|
||||
@@ -43,6 +43,9 @@ export interface DicGoods {
|
||||
const str = readJsonFile(FILENAME.DIC_GOODS);
|
||||
let arr = JSON.parse(str);
|
||||
|
||||
type KeysEnum<T> = { [P in keyof Required<T>]: true };
|
||||
const DicGoodsKeys: KeysEnum<DicGoods> = {good_id: true, name: true, lvLimted: true, pieces: true, composeMaterial: true, decomposeItem: true, quality: true, hole: true, itid: true, goodType: true, hid: true, goodsAbility: true, goodsAbilityUp: true, setid: true, specialAttr: true, value: true }
|
||||
|
||||
export const dicGoods = new Map<number, DicGoods>();
|
||||
export const blueprt = new Map<number, Array<number>>();
|
||||
|
||||
@@ -52,7 +55,7 @@ arr.forEach(o => {
|
||||
o.composeMaterial = parseReward(o.composeMaterial);
|
||||
o.decomposeItem = parseReward(o.decomposeItem);
|
||||
o.specialAttr = parseSpecialAttr(o.specialAttr);
|
||||
dicGoods.set(o.good_id, o);
|
||||
dicGoods.set(o.good_id, _.pick(o, Object.keys(DicGoodsKeys)));
|
||||
|
||||
if(o.itid == IT_TYPE.BLUEPRT) {
|
||||
let arr = blueprt.get(o.quality)||new Array<number>();
|
||||
|
||||
Reference in New Issue
Block a user