// constructor public Store() { lemon = new Lemon(); ice = new Ice(); sugar = new Sugar(); cup = new Cup(); }
//constructor public Inventory() { cups = new Cup(); lemons = new Lemon(); sugar = new Sugar(); ice = new Ice(); }
public void AddSugar(decimal amount) { for (int i = 0; i < amount; i++) { Sugar sugar = new Sugar(); sugars.Add(sugar); } }
private void SellSugar(Sugar sugar, Player player, Day day) { Console.WriteLine("Need sugar? No problem!" + $" \n type 'yes' to purchase 25 cups of sugar for ${sugar.cost};" + " \n type 'no' to return to the store;" + " \n type 'quit' to exit the game."); string SugarDecision = Console.ReadLine().ToLower().Trim(); switch (SugarDecision) { case "yes": bool enoughmoney = player.wallet.ConfirmWalletBalance(sugar.cost); { if (enoughmoney == true) { player.wallet.SubtractFromBalance(sugar.cost); player.inventory.AddToSugar(); } else { Console.WriteLine("You don't have enough money to purchase this item..." + " \n You will need to use up your current inventory or restart the game after this round." + " \n Press enter to return back to the store."); Console.ReadLine(); } } Console.Clear(); StoreFront(player, day); break; case "no": StoreFront(player, day); break; case "quit": Environment.Exit(0); break; default: Console.Clear(); Console.WriteLine("Please select a valid option."); SellSugar(sugar, player, day); break; } }