28 lines
636 B
TypeScript
28 lines
636 B
TypeScript
/**
|
|
* 英灵随机奖励配置表
|
|
*/
|
|
|
|
import { readFileAndParse } from '../util'
|
|
import { FILENAME } from '../../consts'
|
|
|
|
export interface DicSpiritPlan {
|
|
readonly id: number;
|
|
readonly planId: number;
|
|
readonly spiritId: number;
|
|
readonly weight: number;
|
|
}
|
|
export const dicSpiritPlan = new Map<number, DicSpiritPlan[]>();
|
|
|
|
export function loadSpiritPlan() {
|
|
dicSpiritPlan.clear();
|
|
|
|
let arr = readFileAndParse(FILENAME.DIC_SPIRIT_PLAN);
|
|
|
|
arr.forEach(o => {
|
|
|
|
if (!dicSpiritPlan.has(o.planId)) dicSpiritPlan.set(o.planId, []);
|
|
dicSpiritPlan.get(o.planId).push(o);
|
|
|
|
});
|
|
arr = undefined;
|
|
} |