28 lines
796 B
TypeScript
28 lines
796 B
TypeScript
/**
|
|
* 挑战关随机配置表
|
|
*/
|
|
|
|
import { readFileAndParse } from '../util'
|
|
import { FILENAME } from '../../consts'
|
|
|
|
export interface DicRougeChallengePlan {
|
|
readonly id: number;
|
|
readonly planId: number;
|
|
readonly challengeId: number; // 挑战关卡的id dicRougeChallenge的id
|
|
readonly weight: number; // 权重
|
|
}
|
|
|
|
export const dicRougeChallengePlan = new Map<number, DicRougeChallengePlan[]>();
|
|
export function loadRougeChallengePlan() {
|
|
dicRougeChallengePlan.clear();
|
|
|
|
let arr = readFileAndParse(FILENAME.DIC_ROUGE_CHALLANGE_PLAN);
|
|
|
|
arr.forEach(o => {
|
|
if (!dicRougeChallengePlan.has(o.planId)) {
|
|
dicRougeChallengePlan.set(o.planId, []);
|
|
}
|
|
dicRougeChallengePlan.get(o.planId).push(o);
|
|
});
|
|
arr = undefined;
|
|
} |