packing tiles for more efficient transfer

This commit is contained in:
Evan
2025-02-01 12:05:11 -08:00
parent 2441abd7c8
commit 1bbb5c9ac3
8 changed files with 126 additions and 26 deletions
+7 -1
View File
@@ -46,7 +46,8 @@ export class PlayerImpl implements MutablePlayer {
private relations = new Map<Player, number>()
constructor(private gs: GameImpl, private readonly playerInfo: PlayerInfo, startPopulation: number) {
constructor(private gs: GameImpl, private _smallID: number, private readonly playerInfo: PlayerInfo, startPopulation: number) {
this._name = playerInfo.name;
this._targetTroopRatio = 1
this._troops = startPopulation * this._targetTroopRatio;
@@ -61,6 +62,7 @@ export class PlayerImpl implements MutablePlayer {
name: this.name(),
displayName: this.displayName(),
id: this.id(),
smallID: this.smallID(),
type: this.type(),
isAlive: this.isAlive(),
tilesOwned: this.numTilesOwned(),
@@ -73,6 +75,10 @@ export class PlayerImpl implements MutablePlayer {
}
}
smallID(): number {
return this._smallID
}
name(): string {
return this._name;
}