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()); } }
/* 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; } }
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()); }
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]); }
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]); } }
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]); } } }