add adjusted population

This commit is contained in:
1brucben
2025-05-06 17:43:32 +02:00
parent a266b8d096
commit 250e75eadd
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -361,6 +361,7 @@ export interface Player {
// Resources & Population
gold(): Gold;
population(): number;
adjustedPopulation(): number;
workers(): number;
troops(): number;
targetTroopRatio(): number;
+3
View File
@@ -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);
}