装备:随机属性
This commit is contained in:
27
shared/pubUtils/dictionary/DicRandomEffectPoolPlan.ts
Normal file
27
shared/pubUtils/dictionary/DicRandomEffectPoolPlan.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
// 武将特技表
|
||||
import { readFileAndParse } from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
|
||||
export interface DicRandomEffectPoolPlan {
|
||||
// 方案id
|
||||
readonly planId: number;
|
||||
// 值
|
||||
readonly num: number;
|
||||
// 权重
|
||||
readonly weight: number;
|
||||
}
|
||||
|
||||
export const dicRandomEffectPoolPlan = new Map<number, DicRandomEffectPoolPlan[]>(); // planId => [{num,weight}]
|
||||
export function loadRandomEffectPoolPlan() {
|
||||
dicRandomEffectPoolPlan.clear();
|
||||
|
||||
let arr = readFileAndParse(FILENAME.DIC_RANDOM_EFFECT_POOL_PLAN);
|
||||
|
||||
arr.forEach(o => {
|
||||
if(!dicRandomEffectPoolPlan.has(o.planId)) {
|
||||
dicRandomEffectPoolPlan.set(o.planId, []);
|
||||
}
|
||||
dicRandomEffectPoolPlan.get(o.planId).push(o);
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user