public void Sell(Sweets sweet, decimal qty) { if (sweetInventory[sweet.GetType()] > qty) { sweetInventory[sweet.GetType()] -= qty; moneyInDrawer += pricesOfSweets[sweet.GetType()] * qty; } ; }
public void CreateSweets(Sweets sweet) { if (sweet.sugarNeeded < sugarInventory) { sweetInventory[sweet.GetType()] += 1; sugarInventory -= sweet.sugarNeeded; } else { Console.WriteLine($"Not enough sugar to create the {sweet.GetType().Name}."); }; }