28 lines
619 B
TypeScript
28 lines
619 B
TypeScript
// 开启功能表
|
|
import { readFileAndParse } from '../util';
|
|
import { FILENAME } from '../../consts';
|
|
|
|
export interface DicFuncSwitch {
|
|
// 功能id
|
|
readonly id: number;
|
|
// 描述
|
|
readonly desc: string;
|
|
// 条件
|
|
readonly conditionType: number;
|
|
// 参数
|
|
readonly param: number;
|
|
// 客户端指令
|
|
readonly script: string;
|
|
|
|
}
|
|
|
|
export const dicFuncSwitch = new Map<number, DicFuncSwitch>();
|
|
export function loadFuncSwitch() {
|
|
let arr = readFileAndParse(FILENAME.DIC_FUNC_SWITCH);
|
|
|
|
arr.forEach(o => {
|
|
dicFuncSwitch.set(o.id, o);
|
|
});
|
|
arr = undefined;
|
|
}
|