Exemple #1
0
 public void FillEnergy(eEngineEnergyTypes i_EngineType, float i_AmountToAdd)
 {
     try
     {
         r_Engine.FillEnergy(i_EngineType, i_AmountToAdd);
         m_RemainingEnergyPercentage = r_Engine.GetRemainingEnergyPercentage();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #2
0
        public void ChargeVehicleElectricEngine(string i_LicenseNumber, float i_ChargingAddition)
        {
            Engine vehicleEngine = AllVehicles[i_LicenseNumber].Vehicle.Engine;

            bool isElectricEngine = vehicleEngine is ElectricEngine;

            if (isElectricEngine)
            {
                vehicleEngine.FillEnergy(i_ChargingAddition);
            }
            else
            {
                throw new ArgumentException("This vehicle is not powered by an electric engine.\n");
            }
        }
Exemple #3
0
        public void FillVehicleFuelTank(string i_LicenseNumber, FuelEngine.eFuelType i_FuelType, float i_FuelAddition)
        {
            Engine vehicleEngine = AllVehicles[i_LicenseNumber].Vehicle.Engine;

            bool isFuelEngine = vehicleEngine is FuelEngine;

            if (isFuelEngine)
            {
                bool isSuitableFuelType = i_FuelType == (vehicleEngine as FuelEngine).FuelType;

                if (isSuitableFuelType)
                {
                    vehicleEngine.FillEnergy(i_FuelAddition);
                }
                else
                {
                    throw new ArgumentException("The fuel type is not suitable to the vehicle's engine.\n");
                }
            }
            else
            {
                throw new ArgumentException("This vehicle is not powered by a fuel engine.\n");
            }
        }
Exemple #4
0
 public void FillEnergy(int i_FuelType, float i_FuelToAdd)
 {
     r_Engine.FillEnergy(i_FuelType, i_FuelToAdd);
 }
Exemple #5
0
 public void Fill(float i_ToFill)
 {
     m_Engine.FillEnergy(i_ToFill);
 }