体力:添加购买体力功能
This commit is contained in:
22
shared/pubUtils/dictionary/DicApBuy.ts
Normal file
22
shared/pubUtils/dictionary/DicApBuy.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { readFileAndParse, parseGoodStr } from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
import { RewardInter } from '../interface';
|
||||
|
||||
export interface DicApBuy {
|
||||
// 购买次数
|
||||
readonly times: number;
|
||||
// 消耗
|
||||
readonly cost: RewardInter[];
|
||||
}
|
||||
|
||||
export const dicApMaxBuyTimes = { max: 0 };
|
||||
export const dicApBuy = new Map<number, RewardInter[]>();
|
||||
export function loadApBuy() {
|
||||
let arr = readFileAndParse(FILENAME.DIC_AP_BUY_COST);
|
||||
arr.forEach(o => {
|
||||
o.cost = parseGoodStr(o.cost);
|
||||
dicApBuy.set(o.times, o.cost);
|
||||
if(o.times > dicApMaxBuyTimes.max) dicApMaxBuyTimes.max = o.times;
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user