🐞 fix(gvg): 修复gvg显示问题

This commit is contained in:
luying
2023-02-22 21:04:21 +08:00
parent 1190d64d24
commit c9e9184567
6 changed files with 21 additions and 11 deletions

View File

@@ -26,7 +26,7 @@ export interface DicGVGArea {
}
export const dicGVGArea = new Map<number, DicGVGArea>();
export const dicGVGCity = new Map<number, { cityType: number, areaIds: number[], defenseBirth: number, attackBirth: number, cityName: string }>();
export const dicGVGCity = new Map<number, { cityType: number, mapType: number, areaIds: number[], defenseBirth: number, attackBirth: number, cityName: string }>();
export function loadGVGArea() {
dicGVGArea.clear();
dicGVGCity.clear();
@@ -35,7 +35,7 @@ export function loadGVGArea() {
arr.forEach(o => {
o.relateArea = parseNumberList(o.relateArea);
if(!dicGVGCity.has(o.cityId)) {
dicGVGCity.set(o.cityId, { cityType: o.cityType, areaIds: [], defenseBirth: 0, attackBirth: 0, cityName: o.cityName });
dicGVGCity.set(o.cityId, { cityType: o.cityType, mapType: o.mapType, areaIds: [], defenseBirth: 0, attackBirth: 0, cityName: o.cityName });
}
dicGVGCity.get(o.cityId)?.areaIds.push(o.areaId);
if(o.areaType == 1) dicGVGCity.get(o.cityId).defenseBirth = o.areaId;

View File

@@ -1,7 +1,7 @@
// GVG城池
import { FILENAME } from '../../consts'
import { RewardInter } from '../interface';
import { readFileAndParse } from '../util'
import { parseGoodStr, readFileAndParse } from '../util'
export interface DicGVGCityAdd {
// 城池类型 1-大城 2-中城 3-小城
@@ -22,6 +22,7 @@ export function loadGVGCityAdd() {
let arr = readFileAndParse(FILENAME.DIC_GVG_CITY_ADD);
arr.forEach(o => {
o.occupyReward = parseGoodStr(o.occupyReward);
dicGVGCityAdd.set(o.cityType, o);
});
arr = undefined;