public void GenerateRout(Rout rout, DateTime date, Airport fromAirport, Airport toAirport, int seats, FlightFrequency flightFrequency) { float distance = fromAirport.GetDistance(toAirport); Plane plane = FindPlane(distance, seats); if (plane == null) { throw new Exception("Brak samolotu spełniającego kryteria :("); } rout.SetUpFlight(date, fromAirport, toAirport, plane, flightFrequency); }
public void SetUpFlight(DateTime date, Airport fromAirport, Airport toAirport, Plane plane, FlightFrequency flightFrequency) { this.FirstDeparturTime = date; this.FromAirport = fromAirport; this.ToAirport = toAirport; this.Plane = plane; this.FlightFrequency = FlightFrequency; this.FlightLong = CalculateTimeLong(); SetUpFlight(); Plane.Assign(); }
public void SetFlightFrequency(FlightFrequency flightFrequency) { this.FlightFrequency = flightFrequency; }
public Rout(DateTime date, FlightFrequency flightFrequency) { this.FirstDeparturTime = date; this.FlightFrequency = flightFrequency; }