public int IceCubesOnHandAfterMadeRecipe(Recipee recipee, Inventory inventory, Player player) { try { removeIceCubes = player.inventory.iceonhand -= recipee.iceUsedForRecipe; return(removeIceCubes); } catch (Exception) { Console.WriteLine("You do not have that amount in your inventory, try again! \n"); recipee.IceCubesPerCup(inventory, player); throw; } }
//member method (can do) internal void CheckWalletToMakeSureNotBroke(Player player) //instaciate the userinterface class so i can call a method from there { if (Wallet <= 0) //if player have no money left { //UserInterface.ExitGameMessage(); //capital U can just called the method because userinterface is static but dont need this Console.WriteLine("You do not have any more money to buy more supplies. Let's go make your recipe"); recipee.IceCubesPerCup(inventory, player); //Environment.Exit(0); //abrutly ends the game not sure if I want this in my game } else { return; } }
public void PurchaseMoreToRestockInventory(Store store, Player player, Recipee recipee, Inventory inventory) { Console.WriteLine("What would you like to purchase? [L] for Lemons, [S] for Sugar, [I] for Ice, [C] for Cups. \n hit [P] to show the prices, hit [D] when you are done shopping. \n\n"); string purchase = Console.ReadLine().ToLower();//user can put in upper or lower and it'll auto lower it switch (purchase) { case "l": BuyLemons(store, player, inventory); // all of the buy methods are at the bottom break; case "s": BuySugar(store, player, inventory); break; case "i": BuyIce(store, player, inventory); break; case "c": BuyPaperCups(store, player, inventory); break; case "p": differentStuffToBuy.ForEach(Console.WriteLine); //display list PurchaseMoreToRestockInventory(store, player, recipee, inventory); break; case "d": recipee.IceCubesPerCup(inventory, player); break; default: Console.WriteLine("\n Nope lets try that again! Try [L] for Lemons, [S] for Sugar, [I] for Ice, [C] for Cups. \n hit [P] to show the prices, hit [D] when you are done shopping.\n\n"); PurchaseMoreToRestockInventory(store, player, recipee, inventory); break; } }