diff --git a/apps/server/src/domains/game/application/services/GameRoomSession.ts b/apps/server/src/domains/game/application/services/GameRoomSession.ts index 1868b9c..82c6f97 100644 --- a/apps/server/src/domains/game/application/services/GameRoomSession.ts +++ b/apps/server/src/domains/game/application/services/GameRoomSession.ts @@ -14,7 +14,6 @@ import { Player } from "../../entities/player/Player.js"; import { MapStore } from "../../entities/map/MapStore"; import { BombStateStore } from "../../entities/bomb/BombStateStore"; -import { ActiveBombRegistry } from "../../entities/bomb/ActiveBombRegistry.js"; import { createSpawnedPlayer } from "../../entities/player/playerSpawn.js"; import { isValidPosition, @@ -29,7 +28,6 @@ private players: Map; private mapStore: MapStore; private bombStateStore: BombStateStore; - private activeBombRegistry: ActiveBombRegistry; private gameLoop: GameLoop | null = null; private startTime: number | undefined; private startDelayTimer: NodeJS.Timeout | null = null; @@ -42,7 +40,6 @@ this.players = new Map(); this.mapStore = new MapStore(); this.bombStateStore = new BombStateStore(); - this.activeBombRegistry = new ActiveBombRegistry(); playerIds.forEach((playerId) => { // 現在のプレイヤー構成から人数が最も少ないチームを算出する @@ -81,7 +78,7 @@ tickRate, this.players, this.mapStore, - this.activeBombRegistry, + this.bombStateStore.activeBombRegistry, onTick, () => { const resultPayload = buildGameResultPayload( @@ -192,7 +189,7 @@ ): void { const player = this.players.get(ownerPlayerId); const ownerTeamId = player?.teamId ?? -1; - this.activeBombRegistry.registerBomb({ + this.bombStateStore.activeBombRegistry.registerBomb({ bombId, x, y, @@ -220,7 +217,6 @@ this.gameLoop.stop(); this.gameLoop = null; } - this.activeBombRegistry.clear(); this.players.clear(); } } diff --git a/apps/server/src/domains/game/entities/bomb/BombStateStore.ts b/apps/server/src/domains/game/entities/bomb/BombStateStore.ts index b314fe4..19610bd 100644 --- a/apps/server/src/domains/game/entities/bomb/BombStateStore.ts +++ b/apps/server/src/domains/game/entities/bomb/BombStateStore.ts @@ -7,10 +7,7 @@ shouldBroadcastBombHitReport, shouldBroadcastBombPlaced, } from "./bombDedup.js"; -import { - ActiveBombRegistry, - type ActiveBomb, -} from "./ActiveBombRegistry.js"; +import { ActiveBombRegistry } from "./ActiveBombRegistry.js"; /** セッション単位の爆弾重複排除状態と採番状態を保持するストア */ export class BombStateStore {