Beispiel #1
0
 public void Load(IEnergyDrink item)
 {
     if (CurrentStock.Count >= Capacity)
     {
         Console.WriteLine($"The vending machine is full. The {item.Name} cannot be added.");
     }
     else
     {
         CurrentStock.Add(item);
     }
 }
Beispiel #2
0
 public void Load(IReadyMeal item)
 {
     if (CurrentStock.Count >= Capacity)
     {
         Console.WriteLine("The vending machine is full. No more products can be added.");
     }
     else
     {
         CurrentStock.Add(item);
     }
 }