示例#1
0
        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}");
        }
示例#2
0
        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}");
        }