✨ feat(gvg): 添加策划表解析
This commit is contained in:
51
shared/pubUtils/dictionary/DicGVGVestige.ts
Normal file
51
shared/pubUtils/dictionary/DicGVGVestige.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
// GVG遗迹
|
||||
import { FILENAME } from '../../consts'
|
||||
import { RewardInter } from '../interface';
|
||||
import { parseGoodStr, readFileAndParse } from '../util'
|
||||
|
||||
export interface DicGVGVestige {
|
||||
// 唯一id
|
||||
readonly id: number;
|
||||
// 遗迹id
|
||||
readonly vestigeId: number;
|
||||
// 排行
|
||||
readonly rank: number;
|
||||
// 驻扎分
|
||||
readonly score: number;
|
||||
// 机器人的名字
|
||||
readonly name: string;
|
||||
// 显示在上面的形象
|
||||
readonly spine: number;
|
||||
// 显示在详情的头像
|
||||
readonly head: number;
|
||||
// 显示战力
|
||||
readonly ce: number;
|
||||
// 突破奖励
|
||||
readonly onceReward: RewardInter[];
|
||||
// 突破时得到的gvg相关的奖励
|
||||
readonly onceLeagueReward: RewardInter[];
|
||||
// 机器人的出兵表使用
|
||||
readonly warId: number;
|
||||
// 消耗征战令得到的奖励
|
||||
readonly battleReward: RewardInter[];
|
||||
// 消耗征战令得到的gvg相关的奖励
|
||||
readonly battleLeagueReward: RewardInter[];
|
||||
}
|
||||
|
||||
export const dicGVGVestige = new Map<number, Map<number, DicGVGVestige>>(); // 遗迹id => 排行 => dic
|
||||
export function loadGVGVestige() {
|
||||
dicGVGVestige.clear();
|
||||
|
||||
let arr = readFileAndParse(FILENAME.DIC_GVG_VESTIGE);
|
||||
arr.forEach(o => {
|
||||
o.onceReward = parseGoodStr(o.onceReward);
|
||||
o.onceLeagueReward = parseGoodStr(o.onceLeagueReward);
|
||||
o.battleReward = parseGoodStr(o.battleReward);
|
||||
o.battleLeagueReward = parseGoodStr(o.battleLeagueReward);
|
||||
if(!dicGVGVestige.has(o.vestigeId)) {
|
||||
dicGVGVestige.set(o.vestigeId, new Map());
|
||||
}
|
||||
dicGVGVestige.get(o.vestigeId)?.set(o.rank, o);
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user