nukes destroy boats

This commit is contained in:
evanpelle
2024-10-19 19:48:56 -07:00
parent 0a266f5ef8
commit 1a34462f66
4 changed files with 18 additions and 9 deletions
+2
View File
@@ -233,6 +233,7 @@ export interface Game {
nations(): Nation[]
config(): Config
displayMessage(message: string, type: MessageType, playerID: PlayerID | null): void
boats(): Boat[]
}
export interface MutableGame extends Game {
@@ -241,6 +242,7 @@ export interface MutableGame extends Game {
players(): MutablePlayer[]
addPlayer(playerInfo: PlayerInfo, troops: number): MutablePlayer
executions(): Execution[]
boats(): MutableBoat[]
}
export class TileEvent implements GameEvent {
+4
View File
@@ -10,6 +10,7 @@ import {AllianceRequestImpl} from "./AllianceRequestImpl";
import {AllianceImpl} from "./AllianceImpl";
import {ClientID} from "../Schemas";
import {DisplayMessageEvent, MessageType} from "../../client/graphics/layers/EventsDisplay";
import {BoatImpl} from "./BoatImpl";
export function createGame(terrainMap: TerrainMap, eventBus: EventBus, config: Config): Game {
return new GameImpl(terrainMap, eventBus, config)
@@ -57,6 +58,9 @@ export class GameImpl implements MutableGame {
n.strength
))
}
boats(): BoatImpl[] {
return Array.from(this._players.values()).flatMap(p => p._boats)
}
nations(): Nation[] {
return this.nations_
}