public void Refuel(string i_LicenseNumber, eEnergyTypes i_FuelType, float i_AmmountToFill) { foreach (Vehicle vehilcle in m_GarageManager.Keys) { if (vehilcle.LicenseNumber.Equals(i_LicenseNumber)) { vehilcle.Refuel(i_AmmountToFill, i_FuelType); break; } } }
internal void Refuel(float i_Ammount, eEnergyTypes i_FuelType) { if (m_TypeOfEnergy == eEnergyTypes.Electric) { throw new ArgumentException("Cannot fuel an electric vehicle!"); } else if (m_TypeOfEnergy != i_FuelType) { throw new ArgumentException(string.Format( @"Invalid fuel type! Expected fuel type: {0} Received fuel type: {1}", m_TypeOfEnergy.ToString(), i_FuelType.ToString())); } else { m_VehicleEnergy.FillUp(i_Ammount); } }
public virtual void SetVehicleDetails(Dictionary <string, object> i_VehilceInfo) { this.m_ModelName = (string)i_VehilceInfo["Model"]; this.m_TypeOfEnergy = (eEnergyTypes)i_VehilceInfo["EnergyType"]; createWheels((int)i_VehilceInfo["NumberOfWheels"], (string)i_VehilceInfo["WheelManufacturer"], (float)i_VehilceInfo["CurrentAirPressure"], (float)i_VehilceInfo["MaxAirPressure"]); }
protected EnergySource(eEnergyTypes i_EnergyType) { this.m_EnergyType = i_EnergyType; }
internal Fuel(float i_CurrentFuel, float i_MaxFuelCapacity, eEnergyTypes i_FuelType) { m_FuelState = new ResourceManager(i_CurrentFuel, i_MaxFuelCapacity); m_FuelType = i_FuelType; }