Example #1
0
    bool CheckWinner()
    {
        var winner = Grid.CheckWinConditions();

        if (winner != 0)
        {
            if (winner == -1)
            {
                playerWin.text = $" Stalemate! ";
            }
            else
            {
                playerWin.text = $"Player {winner} won!";
            }
            restartGame.text = "Press 'R' to play again";

            _cellSelector.enabled     = false;
            _rotationSelector.enabled = false;

            _canRestart = true;
            return(true);
        }

        return(false);
    }