public void InflateWheelsToMaxPressure(string i_LicenseNumber) { VehiclesInTheGarage currentVehicleInTheGarage = null; if (m_VehiclesInTheGarage.TryGetValue(i_LicenseNumber, out currentVehicleInTheGarage)) { currentVehicleInTheGarage.Vehicle.InflateToMax(); } else { throw new ArgumentException("There was an error, please try again."); } }
public void ChangeVehicleStatus(string i_LicenseNumber, Vehicle.eStatusOfVehicle i_NewVehicleStatus) { VehiclesInTheGarage currentVehicleInTheGarage = null; if (m_VehiclesInTheGarage.TryGetValue(i_LicenseNumber, out currentVehicleInTheGarage)) { currentVehicleInTheGarage.VehicleStatus = i_NewVehicleStatus; } else { throw new ArgumentException("The vehicle is not in the garage."); } }
public string GetAllVehicleDetails(string i_LicenseNumber) { VehiclesInTheGarage vehicleEntered = null; string resultStr = null; if (m_VehiclesInTheGarage.TryGetValue(i_LicenseNumber, out vehicleEntered)) { resultStr = vehicleEntered.ToString(); } else { throw new ArgumentException("The vehicle is not in the garage."); } return(resultStr); }
public void VehicleGasRefule(string i_LicenseNumber, Vehicle.eGasTypes i_GasType, float i_GasAmount) { VehiclesInTheGarage currentVehicleInTheGarage = null; if (m_VehiclesInTheGarage.TryGetValue(i_LicenseNumber, out currentVehicleInTheGarage)) { GasEngine gasVehicle = currentVehicleInTheGarage.Vehicle.Engine as GasEngine; if (gasVehicle != null) { gasVehicle.Refuel(i_GasAmount, i_GasType); } else { throw new ArgumentException("This vehicle needs a different fuel type."); } } else { throw new ArgumentException("The vehicle is not in the garage."); } }
public void VehicleElectricCharge(string i_LicenseNumber, float i_AmountInMinutes) { VehiclesInTheGarage vehicleEntered = null; if (m_VehiclesInTheGarage.TryGetValue(i_LicenseNumber, out vehicleEntered)) { ElectricEngine electricVehicle = vehicleEntered.Vehicle.Engine as ElectricEngine; if (electricVehicle != null) { float power = i_AmountInMinutes / 60.0f; electricVehicle.ChargingBattery(power); } else { throw new ArgumentException("The vehicle is not in the garage."); } } else { throw new ArgumentException("The vehicle is not in the garage."); } }