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); } }
public Vehicle(EnergyOfEngine i_VehicleEnergySource) { VehiclePropulsion = i_VehicleEnergySource; }
public Truck(EnergyOfEngine i_TypeOfEnergy) : base(i_TypeOfEnergy) { this.WheelsOfVehicle = new Wheel[12]; }
public abstract void EnergyToVehicle(float i_AmountToAdd, EnergyOfEngine i_TypeOfEnergy);
public Car(EnergyOfEngine i_TypeOfEnergy) : base(i_TypeOfEnergy) { this.WheelsOfVehicle = new Wheel[4]; }