示例#1
0
        //Find the best move to do and execute it on the board
        public void DoComputerTurn()
        {
            //Find the list of the best moves to do (1 per unit).
            List <Move> moves = ComputerPlayer.BestMoves();


            foreach (Move m in moves)
            {
                //Ignore duplicate movement moves
                if (m is MovementMove)
                {
                    MovementMove mm = m as MovementMove;
                    if (tiles[mm.x, mm.y].unitOn != null)
                    {
                        continue;
                    }
                }

                //Execute every move
                m.Execute(false);
            }

            playerTurn         = true;
            turnButton.texture = Assets.myTurn;

            Console.WriteLine("Computer turn ended, player map control: " + DepthSearch.CalculateMapControl(tiles));
        }