🦄 refactor(热更新): 分割状态代码和功能代码
This commit is contained in:
21
game-server/app/services/memoryCache/gvgBattleData.ts
Normal file
21
game-server/app/services/memoryCache/gvgBattleData.ts
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user