//member methods public void VisitStand(Day day, Weather weather, Recipe recipe, Wallet wallet, Inventory inventory) { for (int j = 0; j < day.NumberOfCustomers; j++) { CheckWeather(weather, recipe, wallet, inventory); CheckPrice(recipe, weather, wallet, inventory); BuyLemonade(recipe, wallet, inventory); } }
public static void NumberOfLemonades(Inventory inventory) { Console.WriteLine("You have made " + inventory.cupsOfLemonade + " cups of Lemonade."); }
public static void DisplaysWallet(Inventory inventory) { Console.WriteLine("Your wallet has $" + inventory.wallet); }
public void ReadFile(Player player, Inventory inventory, Game game) { string line; string path = "LemonadeSaveFile.txt"; string fullPath = System.IO.Path.GetFullPath(path); List <string> textToRead = new List <string>(); try { System.IO.StreamReader file = new System.IO.StreamReader(fullPath); if ((line = file.ReadLine()) != null) { player.SetName(line); } if ((line = file.ReadLine()) != null) { player.SetCash(Convert.ToDouble(line)); } inventory.Reset(); if ((line = file.ReadLine()) != null) { //lemons inventory.AddLemons(Int32.Parse(line)); } if ((line = file.ReadLine()) != null) { //ice inventory.AddIces(Int32.Parse(line)); } if ((line = file.ReadLine()) != null) { //sugar inventory.AddSugars(Int32.Parse(line)); } if ((line = file.ReadLine()) != null) { //cups inventory.AddCups(Int32.Parse(line)); } if ((line = file.ReadLine()) != null) { //total spent player.SetTotalSpent(Convert.ToDouble(line)); } if ((line = file.ReadLine()) != null) { //total profit player.SetTotalProfit(Int32.Parse(line)); } if ((line = file.ReadLine()) != null) { //current day game.SetCurrentDay(Int32.Parse(line)); } Console.WriteLine("Game loaded."); file.Close(); } catch { Console.WriteLine("Error trying to load file."); } }
public LemonadeStand() { cupsPerPitcher = 12; inventory = new Inventory(); }
public Player() { inventory = new Inventory(); recipe = new Recipe(); wallet = new Wallet(); }
public Store(Player player) { playerWallet = player.wallet; playerInventory = player.inventory; }
public Player() { Wallet wallet = new Wallet(); Inventory inventory = new Inventory(); }
public Player() { CurrentMoney = new Wallet(); CurrentInventory = new Inventory(); recipe = new Recipe(); }
public static void EndDay(Inventory inventory) { Console.WriteLine("You ended today with $" + inventory.moneyCounter + ". and all of your ice has melted"); Console.ReadLine(); Console.Clear(); }
public static void DisplayInventory(Inventory inventory) { Console.WriteLine("\nYou now have $" + inventory.moneyCounter + " and the following ingredients and supplies:\n" + inventory.sugar + " cups of sugar\n" + inventory.lemons + " lemons\n" + inventory.iceCubes + " ice cubes\n" + inventory.cups + " paper cups.\n"); }