From e750afcd652b6e714ce4c9b4af83da2d4016a40e Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 3 Feb 2025 12:54:06 -0800 Subject: [PATCH] has player.units filter by type --- src/core/configuration/DevConfig.ts | 24 ++++++++++++------------ src/core/game/GameView.ts | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/core/configuration/DevConfig.ts b/src/core/configuration/DevConfig.ts index 640154f51..f61eda79f 100644 --- a/src/core/configuration/DevConfig.ts +++ b/src/core/configuration/DevConfig.ts @@ -22,12 +22,12 @@ export class DevConfig extends DefaultConfig { // return 100 } - // unitInfo(type: UnitType): UnitInfo { - // const info = super.unitInfo(type); - // const oldCost = info.cost; - // info.cost = (p: Player) => oldCost(p) / 1000000000; - // return info; - // } + unitInfo(type: UnitType): UnitInfo { + const info = super.unitInfo(type); + const oldCost = info.cost; + info.cost = (p: Player) => oldCost(p) / 1000000000; + return info; + } // tradeShipSpawnRate(): number { // return 10; @@ -45,10 +45,10 @@ export class DevConfig extends DefaultConfig { // return 5000 // } - // numBots(): number { - // return 0 - // } - // spawnNPCs(): boolean { - // return false - // } + numBots(): number { + return 0; + } + spawnNPCs(): boolean { + return false; + } } diff --git a/src/core/game/GameView.ts b/src/core/game/GameView.ts index f28e824a8..1af2860b6 100644 --- a/src/core/game/GameView.ts +++ b/src/core/game/GameView.ts @@ -109,9 +109,9 @@ export class PlayerView { ); } - units(): UnitView[] { + units(...types: UnitType[]): UnitView[] { return this.game - .units() + .units(...types) .filter((u) => u.owner().smallID() == this.smallID()); }