コード例 #1
0
ファイル: Form1.cs プロジェクト: PaulH74/TicTacToe
        /// <summary>
        /// Checks board for a winner, updates scores and resets board for next game
        /// </summary>
        private void CheckWin()
        {
            bool gameOver = false;

            // Check if game is won
            gameOver = game.CheckWin(this);     // Passes in this object (Form1)
            if (gameOver)
            {
                UpdateScores();

                // Check if new game is to be played
                if (game.AnotherGame())
                {
                    PlayNextGame();
                }
                else
                {
                    Application.Exit();
                }
            }
        }