mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-18 00:28:14 +00:00
Revert meta (#1002)
## Description: ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: <DISCORD USERNAME> --------- Co-authored-by: 1brucben <1benjbruce@gmail.com>
This commit is contained in:
@@ -446,7 +446,6 @@ export interface Player {
|
||||
// Resources & Population
|
||||
gold(): Gold;
|
||||
population(): number;
|
||||
totalPopulation(): number;
|
||||
workers(): number;
|
||||
troops(): number;
|
||||
targetTroopRatio(): number;
|
||||
|
||||
@@ -105,7 +105,6 @@ export interface PlayerUpdate {
|
||||
tilesOwned: number;
|
||||
gold: number;
|
||||
population: number;
|
||||
totalPopulation: number;
|
||||
workers: number;
|
||||
troops: number;
|
||||
targetTroopRatio: number;
|
||||
|
||||
@@ -229,9 +229,6 @@ export class PlayerView {
|
||||
population(): number {
|
||||
return this.data.population;
|
||||
}
|
||||
totalPopulation(): number {
|
||||
return this.data.totalPopulation;
|
||||
}
|
||||
workers(): number {
|
||||
return this.data.workers;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ export class PlayerImpl implements Player {
|
||||
) {
|
||||
this._flag = playerInfo.flag;
|
||||
this._name = sanitizeUsername(playerInfo.name);
|
||||
this._targetTroopRatio = 60n;
|
||||
this._targetTroopRatio = 95n;
|
||||
this._troops = toInt(startTroops);
|
||||
this._workers = 0n;
|
||||
this._gold = 0n;
|
||||
@@ -139,7 +139,6 @@ export class PlayerImpl implements Player {
|
||||
tilesOwned: this.numTilesOwned(),
|
||||
gold: Number(this._gold),
|
||||
population: this.population(),
|
||||
totalPopulation: this.totalPopulation(),
|
||||
workers: this.workers(),
|
||||
troops: this.troops(),
|
||||
targetTroopRatio: this.targetTroopRatio(),
|
||||
@@ -652,21 +651,6 @@ export class PlayerImpl implements Player {
|
||||
population(): number {
|
||||
return Number(this._troops + this._workers);
|
||||
}
|
||||
totalPopulation(): number {
|
||||
return this.population() + this.attackingTroops();
|
||||
}
|
||||
private attackingTroops(): number {
|
||||
const landAttackTroops = this._outgoingAttacks
|
||||
.filter((a) => a.isActive())
|
||||
.reduce((sum, a) => sum + a.troops(), 0);
|
||||
|
||||
const boatTroops = this.units(UnitType.TransportShip)
|
||||
.map((u) => u.troops())
|
||||
.reduce((sum, n) => sum + n, 0);
|
||||
|
||||
return landAttackTroops + boatTroops;
|
||||
}
|
||||
|
||||
workers(): number {
|
||||
return Math.max(1, Number(this._workers));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user