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 };