🦄 refactor(热更新): 分割状态代码和功能代码

This commit is contained in:
luying
2023-04-28 20:09:40 +08:00
parent 50a24cb4b8
commit a362a397b5
39 changed files with 676 additions and 622 deletions

View File

@@ -0,0 +1,21 @@
import { pinus } from "pinus";
import { GVGBattleData } from "../gvg/gvgBattleMemory";
// 积分点占领情况groupId_serverType_cityId -> GVGBattleData
const gvgBattleMap: Map<string, GVGBattleData> = new Map();
export function getGVGBattleData(groupKey: string) {
if(!gvgBattleMap.has(groupKey)) {
gvgBattleMap.set(groupKey, new GVGBattleData(groupKey));
pinus.app.set('gvgBattleMap', gvgBattleMap);
}
return gvgBattleMap.get(groupKey);
}
export function getGVGBattleMap() {
return gvgBattleMap;
}
export function clearBattleMemory() {
gvgBattleMap.clear();
}