コード例 #1
0
ファイル: Mover.cs プロジェクト: simantov99/Amiros
        public static void MoveAircraft(Drone drone, MapObject destination, PirateGame game)
        {
            if (game.GetOpponentName() == "12220")
            {
                destination = game.GetMyCities()[1];
            }
            // Get sail options for the pirate to get to the destination
            List <Location> sailOptions = game.GetSailOptions(drone, destination);

            if (game.GetOpponentName() == "12110") // 2nd Week 3rd Bot
            {
                if (drone.Location.Row != game.GetMyCities()[0].Location.Row)
                {
                    game.SetSail(drone, sailOptions[FindSafeSpot(sailOptions, game)]);
                }
                else if (game.GetMyLivingDrones().Count > 10 && game.GetMyLivingDrones()[10].Location.Row == game.GetMyCities()[0].Location.Row)
                {
                    game.SetSail(drone, sailOptions[FindSafeSpot(sailOptions, game)]);
                }
            }
            else
            {
                // Set sail towards the destination
                game.SetSail(drone, sailOptions[FindSafeSpot(sailOptions, game)]);
                // Debug
                game.Debug("Drone " + drone + " sails to " + sailOptions[FindSafeSpot(sailOptions, game)] + game.GetOpponentName().ToString());
            }
        }
コード例 #2
0
ファイル: Class1.cs プロジェクト: yyyair/Skillz
 /* Execute a series of steps */
 public void GoTo(PirateGame game, LinkedList <Location> locationList)
 {
     if (_traveling)
     {
         /* SPirate is currently traveling */
         if (_pirate.GetLocation() == _currentMapTarget.Value)
         {
             //Pirate reached destination
             if (_currentMapTarget.Next == null)
             {
                 _traveling = false;
             }
             else
             {
                 _currentMapTarget = _currentMapTarget.Next;
             }
         }
         else
         {
             //Traveling but still hasn't reached destination
             if (_pirate.IsAlive())
             {
                 game.SetSail(_pirate, game.GetSailOptions(_pirate, _currentMapTarget.Value)[0]);
             }
         }
     }
     else
     {
         //Not traveling, insert new list
         _mapTargetBuffer = locationList;
     }
 }
コード例 #3
0
ファイル: Mover.cs プロジェクト: simantov99/Amiros
        public static void MoveAircraft(Pirate pirate, MapObject destination, PirateGame game)
        {
            // Get sail options for the pirate to get to the destination
            List <Location> sailOptions = game.GetSailOptions(pirate, destination);

            // Set sail towards the destination\
            if (game.GetOpponentName() == "12111")
            {
                game.SetSail(pirate, sailOptions[sailOptions.Count - 1]);
            }
            else
            {
                game.SetSail(pirate, sailOptions[0]);
            }


            // Debug
            game.Debug("Pirate " + pirate + " sails to " + sailOptions[0] + game.GetOpponentName().ToString());
        }
コード例 #4
0
ファイル: Mover.cs プロジェクト: simantov99/Amiros
        public static void MoveAircraft(Aircraft aircraft, MapObject destination, PirateGame game)
        {
            // Get sail options for the pirate to get to the destination
            List <Location> sailOptions = game.GetSailOptions(aircraft, destination);

            // Set sail towards the destination
            game.SetSail(aircraft, sailOptions[0]);

            // Debug
            game.Debug("aircraft " + aircraft + " sails to " + sailOptions[0]);
        }
コード例 #5
0
ファイル: MyBot.cs プロジェクト: BlackD0C/Skillz
 private void HandleDrones(PirateGame game)
 {
     // Go over all of my drones
     foreach (Drone drone in game.GetMyLivingDrones())
     {
         // Get my first city
         City destination = game.GetMyCities()[0];
         // Get sail options
         List <Location> sailOptions = game.GetSailOptions(drone, destination);
         // Set sail!
         game.SetSail(drone, sailOptions[0]);
     }
 }
コード例 #6
0
ファイル: MyBot.cs プロジェクト: BlackD0C/Skillz
 private void HandlePirates(PirateGame game)
 {
     // Go over all of my pirates
     foreach (Pirate pirate in game.GetMyLivingPirates())
     {
         if (!TryAttack(pirate, game))
         {
             // Get the first island
             Island destination = game.GetAllIslands()[0];
             // Get sail options
             List <Location> sailOptions = game.GetSailOptions(pirate, destination);
             // Set sail!
             game.SetSail(pirate, sailOptions[0]);
             // Print a message
             game.Debug("pirate " + pirate + " sails to " + sailOptions[0]);
         }
     }
 }