public void CreateSweets(Sweets sweetToAdd) { if (sweetToAdd.GetType().Name == "Candy") { inventory[0].Add(new Candy()); sugarStored -= CANDY.sugarNeeded; } if (sweetToAdd.GetType().Name == "Lollipop") { inventory[1].Add(new Lollipop()); sugarStored -= LOLLIPOP.sugarNeeded; } }
public void SellSweets(Sweets sweetsToSell, int piece) { if (sweetsToSell.GetType().Name == "Candy") { inventory[0].RemoveRange(0, piece); income += CANDY.price; } if (sweetsToSell.GetType().Name == "Lollipop") { inventory[1].RemoveRange(0, piece); income += LOLLIPOP.price; } }
public void Sell(Sweets sweet, int amount) { //TODO }