public static void AddPassenger(PassengerCarrier thing) { //PassengerCarrier.loadPassenger(); PassengerCarrier carrier = (PassengerCarrier)thing; carrier.loadPassenger(); Console.WriteLine(thing.ToString()); }
static void Main(string[] args) { PassengerCarrier myCarrier = SelectionCarrier.Select(typeOfTrip.beetwenCities, pricePrioriti.middle, timePrioriti.normally); if (myCarrier != null) { Console.WriteLine(myCarrier.Info()); Console.WriteLine($"My carrier is {myCarrier.GetTitle()}"); } Console.ReadKey(); }