Exemple #1
0
        public void RunDay()
        {
            day.customers = new List <Customer>();
            day.weather.Getforecast();
            var recipe = new UserInterface();

            recipe.DisplayRecipe();
            var price = new UserInterface();

            price.DisplayStorePrices();
            var displayWallet = new UserInterface();

            displayWallet.DisplayWalletBalance(player);
            var displayInventory = new UserInterface();

            displayInventory.DisplayInventory(player);
            store.CheckPlayerSolvency(player);
            store.BuyLemons(player);
            store.BuyIce(player);
            store.BuySugar(player);
            store.SellItems(player);
            displayWallet.DisplayWalletBalance(player);
            displayInventory.DisplayInventory(player);
            player.MakeLemonade();
            player.SetLemonadePrice();
            player.validateLemonadePrice();
            day.weather.GetActualWeather();
            DetermineNumberOfCustomers();
            GetProfits();
            AddToWallet();
            Console.WriteLine("-----------------------------------------------------------------------------------------------------------");
        }
Exemple #2
0
        public void GoToTheStore(Store TheStore)
        {
            Console.WriteLine("Welcome to Walmart!");
            List <double> lemonsAndCost = TheStore.BuyLemons();

            PlayerInventory.lemons       += lemonsAndCost[0];
            PlayerInventory.currentMoney -= lemonsAndCost[1];
            PlayerInventory.moneySpent   += lemonsAndCost[1];

            List <double> sugarAndCost = TheStore.BuySugar();

            PlayerInventory.sugar        += sugarAndCost[0];
            PlayerInventory.currentMoney -= sugarAndCost[1];
            PlayerInventory.moneySpent   += sugarAndCost[1];

            List <double> cupsAndCost = TheStore.BuyGlasses();

            PlayerInventory.cups         += cupsAndCost[0];
            PlayerInventory.currentMoney -= cupsAndCost[1];
            PlayerInventory.moneySpent   += cupsAndCost[1];

            List <double> iceAndCost = TheStore.BuyIce();

            PlayerInventory.ice          += iceAndCost[0];
            PlayerInventory.currentMoney -= iceAndCost[1];
            PlayerInventory.moneySpent   += iceAndCost[1];
        }
 public void BuyItems(Store store, Inventory inventory)
 {
     store.BuyLemons(inventory);
     store.BuySugar(inventory);
     store.BuyIce(inventory);
     store.BuyCups(inventory);
     Console.Clear();
     inventory.DisplayInventory();
     inventory.CheckCash(inventory);
     Console.Clear();
 }
Exemple #4
0
        public void BuySupplies(Money money, Inventory inventory, Store store, Customer customer, Recipe recipe, Weather weather, Game game, Day day)
        {
            Console.WriteLine("You have {0} dollars.", money.moneyLeft);
            Console.WriteLine("You currently have {0} lemons, {1} ice cubes, {2} sugar.", inventory.amountOfLemons, inventory.amountOfIceCubes, inventory.amountOfSugarCubes);
            Console.WriteLine("Would you like to buy more supplies for your lemonade stand? 'Yes' or 'No.'");
            string userInput = Console.ReadLine();

            if (userInput.ToLower() == "yes")
            {
                Console.WriteLine("Time to go to the store!");
                store.BuyLemons(money, inventory, customer, recipe, weather, game, store, day);
            }
            else if (userInput.ToLower() == "no")
            {
                Console.WriteLine("Time to sell some lemonade!");
                customer.PotentialCustomers(inventory, money, recipe, weather, customer, game, store, day);
            }
            else
            {
                Console.WriteLine("Error. Please enter 'yes' or 'no'.");
                BuySupplies(money, inventory, store, customer, recipe, weather, game, day);
            }
        }
Exemple #5
0
 public void RunGame()
 {
     userInterface.DisplayInstructions();
     player.GetName();
     for (int i = 1; i <= 7; i++)
     {
         store.StringForecast(currentDay, weatherList);
         store.DisplayForecast(currentDay, weatherList);
         store.BuyLemons(player);
         store.BuySugar(player);
         store.BuyIceCubes(player);
         player.inventory.DisplayInventory();
         player.recipe.DisplayRecipe();
         player.recipe.QuestionRecipe();
         player.recipe.CostPerCup();
         MakeLemonade();
         createCustomers(weatherList[currentDay - 1].customerCount);
         DayStand();
         EndOfDay();
     }
     EndGame();
     connection.InsertHS(totalProfit, player.name);
     connection.DisplayHS();
 }