镇念塔:节点奖励
This commit is contained in:
34
shared/pubUtils/dictionary/DicTowerGift.ts
Normal file
34
shared/pubUtils/dictionary/DicTowerGift.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
// 物品表
|
||||
import { readFileAndParse, parseGoodStr, } from '../util'
|
||||
import { FILENAME, } from '../../consts'
|
||||
import { RewardInter } from '../interface';
|
||||
const _ = require('lodash');
|
||||
|
||||
export interface DicTowerGift {
|
||||
// 奖励id
|
||||
readonly id: number;
|
||||
// 镇念塔层数
|
||||
readonly towerLv: number;
|
||||
// 奖励
|
||||
readonly reward: RewardInter[];
|
||||
}
|
||||
|
||||
type KeysEnum<T> = { [P in keyof Required<T>]: true };
|
||||
const DicTowerGiftKeys: KeysEnum<DicTowerGift> = {
|
||||
id: true,
|
||||
towerLv: true,
|
||||
reward: true,
|
||||
}
|
||||
export const dicTowerGift = new Map<number, DicTowerGift>();
|
||||
|
||||
export function loadTowerGift() {
|
||||
dicTowerGift.clear();
|
||||
let arr = readFileAndParse(FILENAME.DIC_TOWER_GIFT);
|
||||
|
||||
arr.forEach(o => {
|
||||
o.reward = parseGoodStr(o.reward);
|
||||
dicTowerGift.set(o.id, _.pick(o, Object.keys(DicTowerGiftKeys)));
|
||||
});
|
||||
|
||||
arr = undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user