static void parkingTheVehicle(MotorVehicle vehicle, int parkingVehicle) { while (parkingVehicle != 0) { if (parkingVehicle == 1) { PublicAutopark.Add(vehicle); } else if (parkingVehicle == 2) { LogisticAutopark.Add(vehicle); } Console.WriteLine(); Console.WriteLine($"Please write 0, to return to the first menu."); Console.WriteLine($"ATTENTION! - You can add THE SAME vehicle in the parking only once!!!"); parkingVehicle = int.Parse(Console.ReadLine()); if (true) { break; } } }
public virtual void Add(MotorVehicle vehicle) { this.vehicles.Add(vehicle); }
private void MAX(MotorVehicle vehicle) { this.maxPassengers += vehicle.maxPassenger; }
public override void Add(MotorVehicle vehicle) { base.Add(vehicle); MAX(vehicle); }
private void MAX(MotorVehicle vehicle) { this.maxCargoWeight += vehicle.maxCargoWeight; }