public CargoPlane(ManufacturerEnum manufacturer, string model, int flightRange, int cruiseSpeed, int passengersNumber, int carryingCapacity, string usage) : base(manufacturer, model, flightRange, cruiseSpeed, passengersNumber, carryingCapacity) { Usage = usage; }
public PassengerPlane(ManufacturerEnum manufacturer, string model, int flightRange, int cruiseSpeed, int passengersNumber, int carryingCapacity, string passengerClass, bool luggage) : base(manufacturer, model, flightRange, cruiseSpeed, passengersNumber, carryingCapacity) { PassengersClass = passengerClass; Luggage = luggage; }
public static Car CreateCar(ManufacturerEnum manufacturer) { var production = ProductionFactory.CreateProduction(manufacturer); return new Car { Door = production.Door, Engine = production.Engine, Manufacturer = manufacturer.ToString(), Model = production.Model, Tires = production.Tires }; }
public static Car CreateCar(ManufacturerEnum manufacturer) { var production = ProductionFactory.CreateProduction(manufacturer); return(new Car { Door = production.Door, Engine = production.Engine, Manufacturer = manufacturer.ToString(), Model = production.Model, Tires = production.Tires }); }
public static IProduction CreateProduction(ManufacturerEnum manufacturer) { switch (manufacturer) { case ManufacturerEnum.Audi: return new AudiProduction(); case ManufacturerEnum.BMW: return new BmwProduction(); case ManufacturerEnum.Mercedes: return new MercedesProduction(); default: return new VolkswagenProduction(); } }
public static IProduction CreateProduction(ManufacturerEnum manufacturer) { switch (manufacturer) { case ManufacturerEnum.Audi: return(new AudiProduction()); case ManufacturerEnum.BMW: return(new BmwProduction()); case ManufacturerEnum.Mercedes: return(new MercedesProduction()); default: return(new VolkswagenProduction()); } }
public Plane(ManufacturerEnum manufacturer, string model, int flightRange, int cruiseSpeed, int passengersNumber, int carryingCapacity) { if (cruiseSpeed < 0) { throw new ArgumentException(); } if (passengersNumber < 0 || passengersNumber > 1000) { throw new ArgumentOutOfRangeException(); } Manufacturer = manufacturer; Model = model ?? throw new ArgumentNullException(); FlightRange = flightRange; CruiseSpeed = cruiseSpeed; PassengersNumber = passengersNumber; CarryingCapacity = carryingCapacity; }