32 lines
804 B
TypeScript
32 lines
804 B
TypeScript
/**
|
|
* 特性卡奖励卡池方案
|
|
*/
|
|
|
|
import { readFileAndParse } from '../util'
|
|
import { FILENAME } from '../../consts'
|
|
|
|
export interface DicRougePassiveCardPlan {
|
|
readonly id: number;
|
|
readonly planId: number; // 方案编号
|
|
readonly cardId: number; // 角色卡id
|
|
readonly weight: number; // 权重
|
|
}
|
|
|
|
|
|
export const dicRougePassiveCardPlan = new Map<number, DicRougePassiveCardPlan[]>();
|
|
|
|
export function loadRougePassiveCardPlan() {
|
|
dicRougePassiveCardPlan.clear();
|
|
|
|
let arr = readFileAndParse(FILENAME.DIC_ROUGE_PASSIVE_CARD_PLAN);
|
|
|
|
|
|
arr.forEach(o => {
|
|
if (!dicRougePassiveCardPlan.has(o.planId)) {
|
|
dicRougePassiveCardPlan.set(o.planId, []);
|
|
}
|
|
dicRougePassiveCardPlan.get(o.planId).push(o);
|
|
});
|
|
|
|
arr = undefined;
|
|
} |