Exemplo n.º 1
0
        void HandleAIMove()
        {
            Player player = Player.GetPlayerFromTurn(turn, player1, player2);

            if (player.Mode != Player.Modes.Human)
            {
                List <Tuple <int, int> > validMoves = Game.GetValidMoves(board, player.Tile);
                Tuple <int, int>         move       = null;
                if (validMoves.Count > 0)
                {
                    if (player.Mode == Player.Modes.AILegendary)
                    {
                        move = Game.GetAIMove(board, 4, player.Tile);
                    }
                    else if (player.Mode == Player.Modes.AIHard)
                    {
                        move = Game.GetAIMove(board, 3, player.Tile);
                    }
                    else if (player.Mode == Player.Modes.AINormal)
                    {
                        move = Game.GetAIMove(board, 2, player.Tile);
                    }
                    else if (player.Mode == Player.Modes.AIEasy)
                    {
                        move = Game.GetMaxScoreMove(board, player.Tile);
                    }
                }
                HandleNextMove(move);
            }
        }