diff --git a/src/core/game/Game.ts b/src/core/game/Game.ts index fda7d78c4..861fc70e5 100644 --- a/src/core/game/Game.ts +++ b/src/core/game/Game.ts @@ -324,6 +324,8 @@ export class PlayerInfo { } export interface Unit { + hash(): number; + // Common properties. id(): number; type(): UnitType; diff --git a/src/core/game/PlayerImpl.ts b/src/core/game/PlayerImpl.ts index 989afc109..03d0a3b27 100644 --- a/src/core/game/PlayerImpl.ts +++ b/src/core/game/PlayerImpl.ts @@ -925,7 +925,7 @@ export class PlayerImpl implements Player { hash(): number { return ( simpleHash(this.id()) * (this.population() + this.numTilesOwned()) + - this._units.reduce((acc, unit) => acc + (unit as UnitImpl).hash(), 0) + this._units.reduce((acc, unit) => acc + unit.hash(), 0) ); } toString(): string {