public void CreateSweets(Sweet sweet) { if (sweet.SugarNeeded <= SugarInventory) { SugarInventory -= sweet.SugarNeeded; itemsOnStock.Add(sweet); } }
public void Sell(Sweet sweetIWantToSell, int thisAmount) { if (sweetIWantToSell is Candy && thisAmount <= NumberOfCandiesInStore()) { Income += thisAmount * CANDY.Price * percent; for (int i = 0; i < thisAmount; i++) { itemsOnStock.Remove(sweetIWantToSell); } } else if (sweetIWantToSell is Lollipop && thisAmount <= NumberOfLolliesInStore()) { Income += thisAmount * LOLLIPOP.Price * percent; for (int i = 0; i < thisAmount; i++) { itemsOnStock.Remove(sweetIWantToSell); } } }