public string RegisterTrip(string source, string destination, string planeType) { IAirplane airplane = airplaneFactory.CreateAirplane(planeType); ITrip trip = new Trip(source, destination, airplane); this.airport.AddTrip(trip); return($"Registered trip {trip.Id}"); }
public string RegisterTrip(string source, string destination, string planeType) { //Creates a trip with that source and destination and adds it to the airport. The Id is auto-generated from the Trip class itself. // The command returns "Registered trip {tripId}". var airplane = airplaneFactory.CreateAirplane(planeType); var trip = new Trip(source, destination, airplane); this.airport.AddTrip(trip); return($"Registered trip {trip.Id}"); }