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