public static void Main(string[] args) { CandyShop candyShop = new CandyShop(300); candyShop.CreateSweetsCandy(candyShop); candyShop.CreateSweetsLollipop(candyShop); candyShop.CreateSweetsCandy(candyShop); candyShop.CreateSweetsLollipop(candyShop); candyShop.PrintInfo(); candyShop.SellCandy(1); candyShop.SellLollipop(2); candyShop.PrintInfo(); }
public Candy(CandyShop candyShop) { candyShop.SugarAmount -= SugarToMake; candyShop.Storage[0]++; }
public void CreateSweetsCandy(CandyShop candyShop) { Candy candy = new Candy(candyShop); }
public void CreateSweetsLollipop(CandyShop candyShop) { Lollipop lollipop = new Lollipop(candyShop); }
public Lollipop(CandyShop candyShop) { candyShop.SugarAmount -= SugarToMake; candyShop.Storage[1]++; }