37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
/**
|
|
* 科技树法阵配置
|
|
*/
|
|
|
|
import { parseNumberList, readFileAndParse } from '../util'
|
|
import { FILENAME } from '../../consts'
|
|
const _ = require('lodash');
|
|
|
|
export interface DicRougeTechLevel {
|
|
readonly techId: number; // 对应等级
|
|
readonly level: number; // 等级
|
|
readonly ce: number; // 战力
|
|
readonly techEffectIds: number[]; // 加成
|
|
}
|
|
|
|
type KeysEnum<T> = { [P in keyof Required<T>]: boolean };
|
|
const DicRougeTechCircleKeys: KeysEnum<DicRougeTechLevel> = {
|
|
techId: true,
|
|
level: true,
|
|
ce: true,
|
|
techEffectIds: true,
|
|
}
|
|
|
|
export const dicRougeTechLevel = new Map<number, DicRougeTechLevel[]>();
|
|
|
|
export function loadRougeTechLevel() {
|
|
dicRougeTechLevel.clear();
|
|
|
|
let arr = readFileAndParse(FILENAME.DIC_ROUGE_TECH_LEVEL);
|
|
|
|
arr.forEach(o => {
|
|
o.techEffectIds = parseNumberList(o.techEffectId);
|
|
if(!dicRougeTechLevel.has(o.techId)) dicRougeTechLevel.set(o.techId, []);
|
|
dicRougeTechLevel.get(o.techId)?.push(_.pick(o, Object.keys(DicRougeTechCircleKeys)));
|
|
});
|
|
arr = undefined;
|
|
} |