public override void EnergyToVehicle(float i_AmountToAdd, EnergyOfEngine i_TypeOfEnergy)
        {
            if (i_TypeOfEnergy.CurrentAmountOfEnergy + i_AmountToAdd <= i_TypeOfEnergy.MaxAmountOfEnergy && i_AmountToAdd >= 0)
            {
                CurrentAmountOfEnergy += i_AmountToAdd;
                GarageManagment.IsMax  = false;
            }

            else
            {
                ValueOutOfRangeException ex = new ValueOutOfRangeException(0, i_TypeOfEnergy.MaxAmountOfEnergy, "You cant add this Amount Of Energy");
                GarageManagment.IsMax = true;
                string msg = ex.Message;
                Console.WriteLine(msg);
            }
        }
예제 #2
0
 public Vehicle(EnergyOfEngine i_VehicleEnergySource)
 {
     VehiclePropulsion = i_VehicleEnergySource;
 }
예제 #3
0
 public Truck(EnergyOfEngine i_TypeOfEnergy) : base(i_TypeOfEnergy)
 {
     this.WheelsOfVehicle = new Wheel[12];
 }
예제 #4
0
 public abstract void EnergyToVehicle(float i_AmountToAdd, EnergyOfEngine i_TypeOfEnergy);
예제 #5
0
 public Car(EnergyOfEngine i_TypeOfEnergy) : base(i_TypeOfEnergy)
 {
     this.WheelsOfVehicle = new Wheel[4];
 }