✨ feat(稷下学宫): ff931afe4到7421822f6
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* 随机关卡配置表
|
||||
*/
|
||||
|
||||
import { readFileAndParse } from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
|
||||
export interface DicRougeRandomEventPlan {
|
||||
readonly id: number;
|
||||
readonly planId: number;
|
||||
readonly randomEventId: number; // 随机关卡的id dicRougeEventOption中的randomEventId
|
||||
readonly weight: number; // 权重
|
||||
}
|
||||
|
||||
export const dicRougeRandomEventPlan = new Map<number, DicRougeRandomEventPlan[]>();
|
||||
export function loadRougeRandomEventPlan() {
|
||||
dicRougeRandomEventPlan.clear();
|
||||
|
||||
let arr = readFileAndParse(FILENAME.DIC_ROUGE_RANDOM_EVENT_PLAN);
|
||||
|
||||
arr.forEach(o => {
|
||||
if (!dicRougeRandomEventPlan.has(o.planId)) {
|
||||
dicRougeRandomEventPlan.set(o.planId, []);
|
||||
}
|
||||
dicRougeRandomEventPlan.get(o.planId).push(o);
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user