Exemplo n.º 1
0
 public static Location GetTarget <T>(Pirate pirate, PirateGame game, MapObject Obj, int range)
 {
     if (game.GetEnemyLivingDrones().Count > 0)
     {
         if (TryGetTargetList(Obj, game, range))
         {
             List <Aircraft> targets = GetTargetList(Obj, game, range);
             if (targets.Where(c => c.GetType().Equals(typeof(T))).ToList().Count > 0)
             {
                 return(targets.Where(c => c.GetType().Equals(typeof(T))).ToList()[0].Location);
             }
         }
     }
     return(game.GetNotMyCities().OrderBy(c => c.Distance(Obj)).ToList()[0].Location);
 }