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(); }
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(); }