コード例 #1
0
        /// <summary>
        /// Register move on tile.
        /// </summary>
        /// <param name="tilePosition">Position of the move tile.</param>
        private void TileClick(string tilePosition)
        {
            if (IsGameOver)
            {
                ResetTileTextColour();
            }

            if (_ticTacToeModel.MakeHumanMove(tilePosition) == false)
            {
                /* Invalid move */
                return;
            }

            UpdateTileText();

            if (IsGameOver)
            {
                while (WinningTiles.Count != 0)
                {
                    SetTileTextColour(WinningTiles.Dequeue(), "LimeGreen");
                }
            }
        }