Ejemplo n.º 1
0
        private void createNewMotorcycle()
        {
            m_Wheels = GarageMain.CreateWheels(m_WheelManufacturer, m_WheelMaxAirPressure, m_WheelCurrentAirPressure,
                                               2);
            Motorcycle newMotorcycle = null;

            if (m_VehicleType == eVehicleType.FuelBased)
            {
                FuelBasedEnergy fuelBasedEnergy =
                    GarageMain.CreateFuelBasedEnergy(m_FuelType, m_MaxFuelAmount, m_CurrentFuelAmount);
                newMotorcycle = GarageMain.CreateMotorcycle(fuelBasedEnergy, m_Wheels, m_LicenseNumber,
                                                            m_ModelName, m_MotorcycleLicenseType, m_MotorcycleEngineVolume);
            }

            if (m_VehicleType == eVehicleType.Electric)
            {
                ElectricEnergy electricEnergy =
                    GarageMain.CreateElectricEnergy(m_MaxBatteryTimeAmount, m_CurrentBatteryTimeAmount);
                newMotorcycle = GarageMain.CreateMotorcycle(electricEnergy, m_Wheels, m_LicenseNumber, m_ModelName,
                                                            m_MotorcycleLicenseType, m_MotorcycleEngineVolume);
            }

            Garage.AddNewVehicle(newMotorcycle, m_OwnerName, m_OwnerPhoneNumber);
            vehicleAddedSuccessfullyMessage();
        }
Ejemplo n.º 2
0
        private void createNewCar()
        {
            m_Wheels = GarageMain.CreateWheels(m_WheelManufacturer, m_WheelMaxAirPressure, m_WheelCurrentAirPressure,
                                               4);
            Car newCar = null;

            if (m_VehicleType == eVehicleType.FuelBased)
            {
                FuelBasedEnergy fuelBasedEnergy =
                    GarageMain.CreateFuelBasedEnergy(m_FuelType, m_MaxFuelAmount, m_CurrentFuelAmount);

                newCar = GarageMain.CreateCar(fuelBasedEnergy, m_Wheels, m_LicenseNumber, m_ModelName,
                                              m_CarColor, m_CarNumberOfDoors);
            }

            if (m_VehicleType == eVehicleType.Electric)
            {
                ElectricEnergy electricEnergy =
                    GarageMain.CreateElectricEnergy(m_MaxBatteryTimeAmount, m_CurrentBatteryTimeAmount);

                newCar = GarageMain.CreateCar(electricEnergy, m_Wheels, m_LicenseNumber, m_ModelName,
                                              m_CarColor, m_CarNumberOfDoors);
            }

            Garage.AddNewVehicle(newCar, m_OwnerName, m_OwnerPhoneNumber);
            vehicleAddedSuccessfullyMessage();
        }
Ejemplo n.º 3
0
        private void createNewTruck()
        {
            m_Wheels = GarageMain.CreateWheels(m_WheelManufacturer, m_WheelMaxAirPressure,
                                               m_WheelCurrentAirPressure, 12);
            FuelBasedEnergy fuelBasedEnergy =
                GarageMain.CreateFuelBasedEnergy(m_FuelType, m_MaxFuelAmount, m_CurrentFuelAmount);
            Truck newTruck = GarageMain.CreateTruck(fuelBasedEnergy, m_Wheels, m_LicenseNumber, m_ModelName,
                                                    m_IsContainsDangerousMaterials, m_TruckCargoVolume);

            Garage.AddNewVehicle(newTruck, m_OwnerName, m_OwnerPhoneNumber);
            vehicleAddedSuccessfullyMessage();
        }