Exemple #1
0
 public void CreateSweets(Sweet sweet)
 {
     if (sweet.SugarNeeded <= SugarInventory)
     {
         SugarInventory -= sweet.SugarNeeded;
         itemsOnStock.Add(sweet);
     }
 }
Exemple #2
0
 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);
         }
     }
 }