Files
ZYZ/game-server/app/services/memoryCache/gvgBattleData.ts

22 lines
606 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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();
}