public void InflateWheelsToMax(string i_LicensePlate) { VehicleInGarage vehicleInGarageToUpdate = FindAndReturnVehicleInGarage(i_LicensePlate); Wheel[] VehicleWheelsToInflate = vehicleInGarageToUpdate.Vehicle.Wheels; for (int i = 0; i < VehicleWheelsToInflate.Length; i++) { VehicleWheelsToInflate[i].Inflate(VehicleWheelsToInflate[i].MaxAirPressure - VehicleWheelsToInflate[i].CurrentAirPressure); } }
// methods: public override bool Equals(object obj) { bool isEqual = false; VehicleInGarage vehicleInGarageToCompare = obj as VehicleInGarage; if (vehicleInGarageToCompare != null) { isEqual = this.GetHashCode() == obj.GetHashCode(); } return(isEqual); }
public void ChargeElectricVehicle(string i_LicensePlate, float i_MinutesToCharge) { VehicleInGarage vehicleInGarageToUpdate = FindAndReturnVehicleInGarage(i_LicensePlate); if (vehicleInGarageToUpdate.Vehicle.Engine is ElecrticEngine) { ((ElecrticEngine)vehicleInGarageToUpdate.Vehicle.Engine).ChargeBattery(i_MinutesToCharge / 60); vehicleInGarageToUpdate.Vehicle.UpdateEnergyPercentage(); } else { throw new ArgumentException("This is not an Electric vehicle."); } }
public void RefuelGasVehicle(string i_LicensePlate, GasEngine.eFuelType i_FuelType, float i_AmountOfFuelToAdd) { VehicleInGarage vehicleInGarageToUpdate = FindAndReturnVehicleInGarage(i_LicensePlate); if (vehicleInGarageToUpdate.Vehicle.Engine is GasEngine) { ((GasEngine)vehicleInGarageToUpdate.Vehicle.Engine).Refueling(i_AmountOfFuelToAdd, i_FuelType); vehicleInGarageToUpdate.Vehicle.UpdateEnergyPercentage(); } else { throw new ArgumentException("This is not a fuel based vehicle."); } }
public string GetVehicleInfo(string i_LicensePlate) { VehicleInGarage vehicleInGarageToShow = FindAndReturnVehicleInGarage(i_LicensePlate); return(vehicleInGarageToShow.ToString()); }
public void ChangeVehicleStatus(string i_LicensePlate, VehicleInGarage.eStatus i_NewStatus) { VehicleInGarage vehicleInGarageToUpdate = FindAndReturnVehicleInGarage(i_LicensePlate); vehicleInGarageToUpdate.Status = i_NewStatus; }
// Methods: public void AddVehical(VehicleInGarage i_VehicalToAdd) { m_VehicelsList.Add(i_VehicalToAdd.GetHashCode(), i_VehicalToAdd); }