public void AddAll() { foreach (Flight flight in flights) { VisitCounter visit = SearchVist(flight); visit.GetFlights().Add(flight); } }
public void Origin(String origin) { foreach (Flight flight in flights) { if (flight.GetOrigin().GetName().Equals(origin)) { VisitCounter visit = SearchVist(flight); visit.GetFlights().Add(flight); } } }
public void Destination(String destination) { foreach (Flight flight in flights) { if (flight.GetDestination().GetName().Equals(destination)) { VisitCounter visit = SearchVist(flight); visit.GetFlights().Add(flight); } } }
public void DelayedFlights(Boolean delay) { foreach (Flight flight in flights) { if (flight.GetDelay() > 0) ///buscar { VisitCounter visit = SearchVist(flight); visit.GetFlights().Add(flight); } } }
public void Date(DateTime date) { foreach (Flight flight in flights) { if (flight.GetDate().Equals(date)) { VisitCounter visit = SearchVist(flight); visit.GetFlights().Add(flight); } } }
public VisitCounter SearchVist(Flight flight) { VisitCounter visit = null; foreach (VisitCounter counter in visits) { if (counter.GetFlights()[0].SameRelationWithCity(flight)) { visit = counter; } } if (visit == null) { visit = new VisitCounter(); visits.Add(visit); } return(visit); }