private static Motorbike createMotorbike(Engine i_CreatedEngine)
        {
            Motorbike createdVehicle = new Motorbike(string.Empty, string.Empty, i_CreatedEngine, 30f,
                                                     Motorbike.eLicenseType.A, 0);

            return(createdVehicle);
        }
Exemple #2
0
        public static Vehicle CreateNewVehicle(eVehicleType i_VehicleType, string i_plateNumber)
        {
            Vehicle newVehicle = null;

            switch (i_VehicleType)
            {
            case eVehicleType.FuelCar:
                newVehicle = new Car(eVehicleType.FuelCar, i_plateNumber);
                break;

            case eVehicleType.ElectricCar:
                newVehicle = new Car(eVehicleType.ElectricCar, i_plateNumber);
                break;

            case eVehicleType.FuelMotorbike:
                newVehicle = new Motorbike(eVehicleType.FuelMotorbike, i_plateNumber);
                break;

            case eVehicleType.ElectricMotorbike:
                newVehicle = new Motorbike(eVehicleType.ElectricMotorbike, i_plateNumber);
                break;

            case eVehicleType.Truck:
                newVehicle = new Truck(eVehicleType.Truck, i_plateNumber);
                break;

            default:
                break;
            }

            return(newVehicle);
        }
        public static Vehicle CreateVehicle(VehicleCreator.eVehicleTypes chosenVehicleOption)
        {
            Vehicle createdVehicle = null;

            switch (chosenVehicleOption)
            {
            case eVehicleTypes.ElectricCar:
            {
                createdVehicle = new Car(v_Electric);
                break;
            }

            case eVehicleTypes.PetrolCarWithOctan95:
            {
                createdVehicle = new Car(v_Petrol);
                break;
            }

            case eVehicleTypes.PetrolMotorbikeWithOctan98:
            {
                createdVehicle = new Motorbike(v_Petrol);
                break;
            }

            case eVehicleTypes.ElectricMotorbike:
            {
                createdVehicle = new Motorbike(v_Electric);
                break;
            }

            case eVehicleTypes.TruckWithSoler:
            {
                createdVehicle = new Truck(v_Petrol);
                break;
            }
            }

            return(createdVehicle);
        }
        public static Vehicle CreateANewVehicle(int i_VehicleType, string i_LicensePlateNumber)
        {
            Vehicle newVehicle = null;
            Engine  engine     = null;

            switch ((eTypesOfSupportedVehicle)i_VehicleType)
            {
            case eTypesOfSupportedVehicle.FuelMotorbike:
                engine     = new FuelEngine(k_FuelMotoerbikeType, k_FuelMotorbikeTankCapacityInLiters);
                newVehicle = new Motorbike(k_RegularMotorbikeNumberOfWheels, k_RegularMotorbikeMaxAirPreasure, engine, i_LicensePlateNumber);
                break;

            case eTypesOfSupportedVehicle.ElectricMotorbike:
                engine     = new ElectricEngine(k_ElectricMotorbikeMaxBatteryInHours);
                newVehicle = new Motorbike(k_ElectricMotorbikeNumberOfWheels, k_ElectricMotorbikeMaxAirPreasure, engine, i_LicensePlateNumber);
                break;

            case eTypesOfSupportedVehicle.FuelCar:
                engine     = new FuelEngine(k_FuelCarType, k_FuelCarTankCapacityInLiters);
                newVehicle = new Car(k_FuelCarNumberOfWheels, k_FuelCarMaxAirPreasure, engine, i_LicensePlateNumber);
                break;

            case eTypesOfSupportedVehicle.ElectricCar:
                engine     = new ElectricEngine(k_ElectricCarMaxBatteryInHours);
                newVehicle = new Car(k_ElectricCarNumberOfWheels, k_ElectricCarMaxAirPreasure, engine, i_LicensePlateNumber);
                break;

            case eTypesOfSupportedVehicle.Truck:
                engine     = new FuelEngine(k_TruckFuelType, k_FuelTruckTankCapacityInLiters);
                newVehicle = new Truck(k_TruckNumberOfWheels, k_TruckMaxAirPreasure, engine, i_LicensePlateNumber);
                break;

            default:
                throw new ArgumentException();
            }

            return(newVehicle);
        }
Exemple #5
0
        public static Vehicle MakeVehicle(int i_VehicleTypeChoice, string i_LicenseNumber)
        {
            Vehicle newVehicle = null;
            Engine  engine     = null;

            switch ((eSupportedVehicles)i_VehicleTypeChoice)
            {
            case eSupportedVehicles.GasMotorbike:
                engine     = new GasEngine(k_GasMotoebikeGasType, k_GasMotorbikeGasTankInLiters);
                newVehicle = new Motorbike(k_GasMotorbikeNumberOfWheels, k_GasMotorbikeMaxAirPreasure, engine, i_LicenseNumber);
                break;

            case eSupportedVehicles.ElectricMotorbike:
                engine     = new ElectricEngine(k_ElectricMotorbikeMaxBatteryInHours);
                newVehicle = new Motorbike(k_ElectricMotorbikeNumberOfWheels, k_ElectricMotorbikeMaxAirPreasure, engine, i_LicenseNumber);
                break;

            case eSupportedVehicles.GasCar:
                engine     = new GasEngine(k_GasCarGasType, k_GasCarGasTankInLiters);
                newVehicle = new Car(k_GasCarNumberOfWheels, k_GasCarMaxAirPreasure, engine, i_LicenseNumber);
                break;

            case eSupportedVehicles.ElectricCar:
                engine     = new ElectricEngine(k_ElectricCarMaxBatteryInHours);
                newVehicle = new Car(k_ElectricCarNumberOfWheels, k_ElectricCarMaxAirPreasure, engine, i_LicenseNumber);
                break;

            case eSupportedVehicles.Truck:
                engine     = new GasEngine(k_TruckGasType, k_TruckGasTankInLiters);
                newVehicle = new Truck(k_TruckNumberOfWheels, k_TruckMaxAirPreasure, engine, i_LicenseNumber);
                break;

            default:
                throw new ArgumentException();
            }

            return(newVehicle);
        }