点亮科技树

This commit is contained in:
mamengke01
2021-01-29 13:33:26 +08:00
parent 54dde229d3
commit 76e732d62d
27 changed files with 4629 additions and 1358 deletions

View File

@@ -0,0 +1,27 @@
import { readJsonFile, parseGoodStr } from '../util'
import { FILENAME } from '../../consts'
type KeysEnum<T> = { [P in keyof Required<T>]: true };
import { RewardInter } from '../interface';
const _ = require('lodash');
export interface DicArmyDonate {
readonly id: number;
readonly fund: number;
readonly boxRewards: Array<RewardInter>;
}
const DicArmyDonateKeys: KeysEnum<DicArmyDonate> = {
id: true,
fund: true,
boxRewards: true
};
const str = readJsonFile(FILENAME.DIC_ARMY_DONATE_BOX_REWARD);
let arr = JSON.parse(str);
export const dicArmyDonate = new Map<number, DicArmyDonate>();
arr.forEach(o => {
o.boxRewards = parseGoodStr(o.boxReward);
dicArmyDonate.set(o.id, _.pick(o, Object.keys(DicArmyDonateKeys)));
});
arr = undefined;