Esempio n. 1
0
        public static VehicleAbstractFactory CreateFactory(VehiclesTypes vehiclesTypes)
        {
            switch (vehiclesTypes)
            {
            case VehiclesTypes.Car: return(new CarFactory());

            case VehiclesTypes.Motorcycle: return(new MotorcycleFactory());

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Esempio n. 2
0
 public VehicleBase(string model, VehiclesTypes vehiclesTypes, int capacity)
 {
     Model         = model;
     VehiclesTypes = vehiclesTypes;
     Capacity      = capacity;
 }