Esempio n. 1
0
        public override List <Move> Play()
        {
            for (int i = 0; i < UndockedShips.Count; i++)
            {
                Ship ship = UndockedShips[i];

                if (UnownedPlanets.Any())
                {
                    MoveToClosestPlanetAndDock(MoveList, UnownedPlanets, ship);
                }
                else if (DockableOwnedPlanets.Any())
                {
                    MoveToClosestPlanetAndDock(MoveList, DockableOwnedPlanets, ship);
                }
                else if (EnemyPlanets.Any())
                {
                    AttackDockedShipsAtClosestEnemyPlanet(ship);
                }

                if (AreAboutToTimeOut(i))
                {
                    break;
                }
            }

            return(MoveList);
        }
Esempio n. 2
0
        public override List <Move> Play()
        {
            for (int i = 0; i < UndockedShips.Count; i++)
            {
                Ship ship = UndockedShips[i];

                Planet bestPlanetChoice = Navigation.GetClosestPlanetToShipWithinDistance(ship, UnownedPlanets);

                if (bestPlanetChoice == null)
                {
                    bestPlanetChoice = Navigation.GetClosestPlanetToShipWithinDistance(ship, DockableOwnedPlanets);
                }

                if (bestPlanetChoice != null)
                {
                    MoveToPlanetAndDock(MoveList, bestPlanetChoice, ship);
                }
                else if (EnemyPlanets.Any())
                {
                    AttackDockedShipsAtClosestEnemyPlanet(ship);
                }

                if (AreAboutToTimeOut(i))
                {
                    break;
                }
            }

            return(MoveList);
        }