Пример #1
0
 public void CreateSweets(Sweets sweet)
 {
     if (Sugar >= sweet.Sugar)
     {
         Sweets.Add(sweet);
         Sugar -= sweet.Sugar;
     }
 }
Пример #2
0
 public void Selling(Sweets sweet, int pieces)
 {
     for (int i = 0; i < pieces; i++)
     {
         Sweets.Remove(sweet);
         Money += sweet.Price;
     }
 }
Пример #3
0
 public void Sell(Sweets sweet, int pieces)
 {
     if (sweet == CANDY)
     {
         if (InventoryCheck()["candies"] >= pieces)
         {
             Selling(sweet, pieces);
         }
     }
     else
     {
         if (InventoryCheck()["lollipops"] >= pieces)
         {
             Selling(sweet, pieces);
         }
     }
 }
 public void CreateSweets(Sweets sweets)
 {
     CandyShopsStorage.Add(sweets);
 }