private static void CreateAndDisplayTruck(ref IVehicleFactory factory) { factory = AutoMBuilder.Build(BodyType.Truck); IVehicle vehicle = factory.GetVehicle(IgnitionType.Automatic.ToString()); WriteLine($" Vehicle {vehicle.ToString()}"); vehicle = factory.GetVehicle(IgnitionType.Manual.ToString()); WriteLine($" Vehicle {vehicle.ToString()}"); vehicle = factory.GetVehicle(IgnitionType.None.ToString()); WriteLine($" Vehicle {vehicle.ToString()}"); ReadKey(); }
public void Execute(Context context) { var vehicle = _vehicleFactory.GetVehicle(_parkParams.LicensePlate, _parkParams.Owner, _parkParams.Type, _parkParams.Hours, _parkParams.Time, _parkParams.Sector, _parkParams.Place); _state = context.VehiclePark.Park(vehicle, _parkParams.Sector, _parkParams.Place, _parkParams.Time); }