Files
ZYZ/shared/pubUtils/dictionary/DicRougeLayerNodePlan.ts
T

30 lines
916 B
TypeScript

/**
* 试炼难度配置表
*/
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRougeLayerNodePlan {
readonly id: number;
readonly nodePlanId: number; // 随机方案,dicRougeLayer的nodePlan引用
readonly nodeId: number; // 节点的类型,引用的是 dicRougeNode 表的nodeId
readonly weight: number;
}
// export const dicRougeLayerNodePlan = new Map<string, DicRougeLayerNodePlan>();
export const dicRougeLayerNodePlan = new Map<number, DicRougeLayerNodePlan[]>();
export function loadRougeLayerNodePlan() {
dicRougeLayerNodePlan.clear();
let arr = readFileAndParse(FILENAME.DIC_ROUGE_LAYER_NODE_PLAN);
arr.forEach(o => {
if (!dicRougeLayerNodePlan.get(o.nodePlanId)) dicRougeLayerNodePlan.set(o.nodePlanId, []);
dicRougeLayerNodePlan.get(o.nodePlanId).push(o);
});
arr = undefined;
}