From 250e75eaddd31a7aa71238879516e7b710e1190b Mon Sep 17 00:00:00 2001 From: 1brucben <1benjbruce@gmail.com> Date: Tue, 6 May 2025 17:43:32 +0200 Subject: [PATCH] add adjusted population --- src/core/game/Game.ts | 1 + src/core/game/PlayerImpl.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/core/game/Game.ts b/src/core/game/Game.ts index 369c01e98..ebf4857bd 100644 --- a/src/core/game/Game.ts +++ b/src/core/game/Game.ts @@ -361,6 +361,7 @@ export interface Player { // Resources & Population gold(): Gold; population(): number; + adjustedPopulation(): number; workers(): number; troops(): number; targetTroopRatio(): number; diff --git a/src/core/game/PlayerImpl.ts b/src/core/game/PlayerImpl.ts index af24531d6..3bffad0b9 100644 --- a/src/core/game/PlayerImpl.ts +++ b/src/core/game/PlayerImpl.ts @@ -639,6 +639,9 @@ export class PlayerImpl implements Player { workers(): number { return Math.max(1, Number(this._workers)); } + adjustedPopulation(): number { + return this.population() + this.boatTroops() + this.attackingTroops(); + } addWorkers(toAdd: number): void { this._workers += toInt(toAdd); }