コード例 #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("-----------------------------------------------------------------------------------------------------------");
        }
コード例 #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];
        }
コード例 #3
0
 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();
 }
コード例 #4
0
ファイル: Game.cs プロジェクト: ahami14/lemonadestand
 //member methods (Can Do)
 public void RunGame()
 {
     UserInterface.DisplayRules();
     UserInterface.DisplayWeatherForecast(days);
     while (day.numberOfDays <= 7)
     {
         day.CreateCustomer();
         player.recipe.SetRecipe();
         UserInterface.DisplayStock();
         store.BuyCups();
         store.BuyLemon();
         store.BuySugar();
         store.BuyIce();
         Console.WriteLine("Here is your money leftover! " + player.wallet.Money);
         Console.ReadLine();
         player.pitcher.DisplayPitcherCups(player);
         DisplayActualWeather();
         day.ChoiceToBuy(weather, player);
         Console.WriteLine("Here is your amount of money after the day! " + player.wallet.Money);
         Console.ReadLine();
     }
 }
コード例 #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();
 }