From e90cfc3fb94f4dfb104229dd5f18ab6a8ce75ba1 Mon Sep 17 00:00:00 2001 From: variablevince <24507472+VariableVince@users.noreply.github.com> Date: Fri, 24 Oct 2025 04:00:21 +0200 Subject: [PATCH] Comment updates --- src/client/ClientGameRunner.ts | 3 --- src/client/graphics/layers/UnitDisplay.ts | 1 - src/core/game/Game.ts | 7 ++++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/client/ClientGameRunner.ts b/src/client/ClientGameRunner.ts index f4169321d..3d282b373 100644 --- a/src/client/ClientGameRunner.ts +++ b/src/client/ClientGameRunner.ts @@ -419,9 +419,7 @@ export class ClientGameRunner { this.myPlayer = myPlayer; } this.myPlayer.actions(tile, TransportShipFilter.Only).then((actions) => { - // if (this.myPlayer === null) return; //--> redundant check as set above?, but need to add ! below to stop error 'can be null' if (actions.canAttack) { - //-->maybe only get actions.canAttack + transportship from buildableunits? Not everything else? this.eventBus.emit( new SendAttackIntentEvent( this.gameView.owner(tile).id(), @@ -517,7 +515,6 @@ export class ClientGameRunner { } this.myPlayer.actions(tile, TransportShipFilter.Only).then((actions) => { - //-->> maybe only get transportship from buildableunits? Not everything else? if (this.canBoatAttack(actions) !== false) { this.sendBoatAttackIntent(tile); } diff --git a/src/client/graphics/layers/UnitDisplay.ts b/src/client/graphics/layers/UnitDisplay.ts index 9b7a58133..515fc1589 100644 --- a/src/client/graphics/layers/UnitDisplay.ts +++ b/src/client/graphics/layers/UnitDisplay.ts @@ -103,7 +103,6 @@ export class UnitDisplay extends LitElement implements Layer { tick() { const player = this.game?.myPlayer(); player?.actions(undefined, TransportShipFilter.Exclude).then((actions) => { - // player?.actions(undefined, TransportShipFilter.Default).then((actions) => { this.playerActions = actions; }); if (!player) return; diff --git a/src/core/game/Game.ts b/src/core/game/Game.ts index c3be10814..56834b3d6 100644 --- a/src/core/game/Game.ts +++ b/src/core/game/Game.ts @@ -861,8 +861,9 @@ export interface NameViewData { size: number; } +// Filter for buildableUnits export enum TransportShipFilter { - Default = "default", // Include TransportShip with all units - Exclude = "exclude", // Skip TransportShip in the unit list - Only = "only", // Only check TransportShip + Default = "default", // Include + Exclude = "exclude", // Exclude + Only = "only", // TransportShip only }