mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-24 00:23:38 +00:00
add adjusted population
This commit is contained in:
@@ -361,6 +361,7 @@ export interface Player {
|
||||
// Resources & Population
|
||||
gold(): Gold;
|
||||
population(): number;
|
||||
adjustedPopulation(): number;
|
||||
workers(): number;
|
||||
troops(): number;
|
||||
targetTroopRatio(): number;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user