Ejemplo n.º 1
0
        public void RunGame()
        {
            //Game Generate weather
            string todaysWeather = DisplayDailyWeather(day.weather.conditions);

            Message.DisplayMessage(todaysWeather);

            //Player Fill inventory
            Message.DisplayMessage(String.Format("Your current inventory is {0} lemons, {1} cups of sugar, and {2} cups", player.inventory.lemons.Count, player.inventory.sugars.Count, player.inventory.cups.Count));
            store.GetLemons();
            player.AddLemons(store.lemonQty, player.wallet);
            Message.DisplayMessage("New balance: $" + player.wallet.balance);
            store.GetSugar();
            player.AddSugar(store.sugarQty, player.wallet);
            Message.DisplayMessage("New balance: $" + player.wallet.balance);
            store.GetIce();
            player.AddIce(store.iceQty, player.wallet);
            Message.DisplayMessage("New balance: $" + player.wallet.balance);
            store.GetCups();
            player.AddCups(store.cupQty, player.wallet);
            Message.DisplayMessage("New balance: $" + player.wallet.balance);
            spentBalance = 20 - player.wallet.balance;

            //Player set recipe
            ShowRecipe();
            GetNewRecipe(player);

            //Player Set Price
            player.SetPrice();
            player.inventory.GetNewPitcher(player.inventory.pitcher);

            //Create customers//demand
            int customerQty = day.GetCustomerQty();

            day.GenerateCustomer(customerQty);
            day.GetDemand();
            bool buy = day.GetCustomerBuy();

            player.inventory.CheckNewPitcher(player.cupsSold);
            bool empty  = player.inventory.CheckInventory();
            bool endDay = player.CheckCanSell(empty, buy);



            //End day
            day.EndDay();

            //TESTS //working
            //weather.DisplayTest();
            //int lemonQty = inventory.GetLemons();
            //inventory.AddLemons(lemonQty, wallet);
            //Console.WriteLine(wallet.balance);
            //Console.WriteLine(player.inventory.cups.Count + player.inventory.icecubes.Count + player.inventory.lemons.Count + player.inventory.sugars.Count);
            //Console.WriteLine(player.inventory.cups.Count + player.inventory.icecubes.Count + player.inventory.lemons.Count + player.inventory.sugars.Count);

            //TEST INPUT
            //Console.WriteLine("Enter a number");
            //string userInput = Console.ReadLine();
            //bool isInteger = Message.CheckIntegerInput(userInput);
            //Console.WriteLine(isInteger);
            //Message.DisplayMessage("This Customer Demand: " + customer.demand);
            //TEST CUSTOMER DEMAND
        }