public void FillFuel(string i_LicenseId, float i_AmountOfFuel, VehiclesEnums.eFuelType i_TypeOfFuel) { FuelEngine eng = m_Vehicles[i_LicenseId].Vehicle.Engine as FuelEngine; if (eng == null) { throw new ArgumentException(string.Format(k_NotFuelVehicle, i_LicenseId, Environment.NewLine)); } eng.FillFuel(i_AmountOfFuel, i_TypeOfFuel); }
public void FillFuel(float i_AmountOfLiters, VehiclesEnums.eFuelType i_FuelType) { if (m_FuelType == i_FuelType) { try { FillEnergy(i_AmountOfLiters); } catch (ValueOutOfRangeException e) { throw new ValueOutOfRangeException(k_InvalidFuelAmount, e.MinValue, e.MaxValue); } } else { throw new ArgumentException(string.Format(k_InvalidFuelType, m_FuelType, Environment.NewLine)); } }
public FuelEngine(float i_MaxFuelCapacity, VehiclesEnums.eFuelType i_FuelType) : base(i_MaxFuelCapacity) { m_FuelType = i_FuelType; }