From b260aa0441cad1f320609f0409c630d0d7cc93b6 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Mon, 6 Jan 2025 14:36:23 -0800 Subject: [PATCH] control panel works --- src/core/GameView.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/GameView.ts b/src/core/GameView.ts index a26bd7813..418f8ba5a 100644 --- a/src/core/GameView.ts +++ b/src/core/GameView.ts @@ -167,7 +167,7 @@ export class PlayerView implements Player { return this.data.gold } population(): number { - return this.data.workers + return this.data.population } workers(): number { return this.data.workers @@ -303,7 +303,11 @@ export class GameView { } playerByClientID(id: ClientID): Player | null { - return null + const pd = Object.values(this.data.players).filter(p => p.clientID == id)[0] ?? null + if (pd == null) { + return null + } + return new PlayerView(this, pd) } hasPlayer(id: PlayerID): boolean { return false