Ejemplo n.º 1
0
        public void FillEnergy(float i_EnergyAmount, Engine.eFuelType?i_FuelType = null)
        {
            if (VehicleEngine is GasEngine && i_FuelType != (VehicleEngine as GasEngine).FuelType)
            {
                if (i_FuelType == null)
                {
                    throw new ArgumentException("No fuel type recived");
                }
                else
                {
                    throw new ArgumentException("Fuel type not match");
                }
            }

            VehicleEngine.FillEnergy(i_EnergyAmount, this, i_FuelType);
        }