//returns all airports where the airport has demand public List <Airport> getDestinationDemands() { var destinations = new List <DestinationDemand>(); destinations.AddRange(this.Statics.getDemands()); destinations.AddRange(this.DestinationCargo); destinations.AddRange(this.DestinationPassengers); return(destinations.Select(d => Airports.GetAirport(d.Destination)).Distinct().ToList()); }
//returns a list of major destinations and pax public Dictionary <Airport, int> getMajorDestinations() { Dictionary <Airport, int> majorDestinations = new Dictionary <Airport, int>(); foreach (KeyValuePair <string, int> md in this.Profile.MajorDestionations) { majorDestinations.Add(Airports.GetAirport(md.Key), md.Value); } return(majorDestinations); }
//returns all airports within a range public List <Airport> getAirportsWithin(double range) { List <Airport> airports; lock (this.AirportDistances) { if (this.AirportDistances.Count == 0) { foreach (Airport airport in Airports.GetAllAirports()) { addDistance(airport, MathHelpers.GetDistance(this.Airport, airport)); } } airports = new List <Airport>(from a in this.AirportDistances where a.Value <= range select a.Key); } return(airports); }