public void GameplayLoop() { for (int i = 0; i < gameLength; i++) { UI.DisplayInventory(player); if (shop.stopShopping == false) { shop.ShopLoop(player); } if (player.AdjustRecipe()) { RecipeLoop(player); } UI.ShowInformation($"Welcome to Day {dayCount}."); DaySalesLoop(); SummaryLoop(); dayCount++; UI.ShowInformation($"Your total profit so far is ${player.totalDailyProfits}."); UI.GameSummary(player, dayCount, gameLength); } }
public static IngredientsForPurchase WhatToBuy(Player player) { UI.ShowInformation("What product would you like to buy? 'lemon' ('l'), 'ice' ('i'), or 'sugar' ('s'). You may also 'close' ('c') to close the shop."); string ingredientChoice = Console.ReadLine(); switch (ingredientChoice) { case "close": case "c": UI.ShowInformation("Skipping the shop\n"); UI.DisplayInventory(player); return(ingredient); case "lemon": case "l": UI.ShowInformation("purchasing lemons"); UI.DisplayInventory(player); return(ingredient = new Lemon()); case "ice": case "i": UI.ShowInformation("purchasing ice cubes"); UI.DisplayInventory(player); return(ingredient = new IceCubes()); case "sugar": case "s": UI.ShowInformation("purchasing sugar"); UI.DisplayInventory(player); return(ingredient = new Sugar()); default: UI.ShowInformation("please make a valid selection - 'lemon' ('l'), 'ice' ('i'), 'sugar' ('s'), or 'close' ('c')."); UI.DisplayInventory(player); return(WhatToBuy(player)); } }