From c04a4a40b06e73da3ad8c9c5b8e613eb7a27f1ae Mon Sep 17 00:00:00 2001 From: sepia Date: Sun, 20 Jul 2025 19:51:41 -0500 Subject: [PATCH] Minor refactor --- src/game/game-instance.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/game-instance.ts b/src/game/game-instance.ts index 9000c38..cd1b523 100644 --- a/src/game/game-instance.ts +++ b/src/game/game-instance.ts @@ -9,7 +9,7 @@ export class GameInstance { public readonly board: BoardCell[][]; public currentPlayerColor: PlayerColor | null; public status: GameStatus; - public winner: null | PlayerColor | 'draw'; + public winnerColor: null | PlayerColor | 'draw'; public players: { black?: string; white?: string }; private readonly boardSize = 15; @@ -22,7 +22,7 @@ export class GameInstance { ); this.currentPlayerColor = null; this.status = 'waiting'; - this.winner = null; + this.winnerColor = null; this.players = {}; } @@ -105,7 +105,7 @@ export class GameInstance { // Check for win condition if (this.checkWin(row, col, playerColor)) { - this.winner = playerColor; + this.winnerColor = playerColor; this.status = 'finished'; this.currentPlayerColor = null; return { success: true }; @@ -113,7 +113,7 @@ export class GameInstance { // Check for draw condition if (this.moveCount === this.boardSize * this.boardSize) { - this.winner = 'draw'; + this.winnerColor = 'draw'; this.status = 'finished'; this.currentPlayerColor = null; return { success: true };