thread-split events display

This commit is contained in:
Evan
2025-01-12 17:00:23 -08:00
parent 3da6008e9f
commit e76837c75a
8 changed files with 180 additions and 88 deletions
+7 -1
View File
@@ -4,7 +4,7 @@ import { getConfig } from "./configuration/Config";
import { EventBus } from "./EventBus";
import { Executor } from "./execution/ExecutionManager";
import { WinCheckExecution } from "./execution/WinCheckExecution";
import { Cell, DisplayMessageUpdate, Game, GameUpdateType, MessageType, MutableGame, MutableTile, NameViewData, Player, PlayerActions, PlayerID, Tile, TileUpdate, UnitType, UnitUpdate } from "./game/Game";
import { Cell, DisplayMessageUpdate, Game, GameUpdateType, MessageType, MutableGame, MutableTile, NameViewData, Player, PlayerActions, PlayerID, PlayerProfile, Tile, TileUpdate, UnitType, UnitUpdate } from "./game/Game";
import { createGame } from "./game/GameImpl";
import { loadTerrainMap } from "./game/TerrainMapLoader";
import { GameConfig, Turn } from "./Schemas";
@@ -105,6 +105,12 @@ export class GameRunner {
return actions
}
public playerProfile(playerID: number): PlayerProfile {
return {
relations: this.game.players().filter(p => p.smallID() == playerID)[0]?.allRelationsSorted()
}
}
private canBoat(myPlayer: Player, tile: Tile): boolean {
const other = tile.owner()
if (myPlayer.units(UnitType.TransportShip).length >= this.game.config().boatMaxNumber()) {