Exemple #1
0
        public void RunDay()
        {
            int    cupsSold   = 0;
            double dailyGross = 0;

            player.pitcher.cupsLeftInPitcher = 0;
            UserInterface.LiveInfoDisplay(player, days[currentDay - 1], days, dailyGross);


            foreach (Customer customer in days[currentDay - 1].customers)
            {
                if (player.pitcher.cupsLeftInPitcher == 0)
                {
                    bool successfulPour = player.PourPitcher();
                    if (successfulPour == false)
                    {
                        UserInterface.SoldOut();
                        break;
                    }
                }
                bool didBuy = customer.CustomerApproachesStand(player.recipe.pricePerCup, player.recipe.amountOfIceCubes, player.recipe.amountOfLemons, player.recipe.amountOfSugarCups);
                if (didBuy == true)
                {
                    bool successfulPour = player.PourCup();
                    if (successfulPour == false)
                    {
                        UserInterface.SoldOut();
                        break;
                    }
                    else
                    {
                        dailyGross          += player.recipe.pricePerCup;
                        player.wallet.Money += player.recipe.pricePerCup;
                        UserInterface.ClearSpace(player, days[currentDay - 1], days, dailyGross);
                        UserInterface.DisplayPurchase(dailyGross, customer.name);
                        cupsSold += 1;
                    }
                }
                else
                {
                    UserInterface.ClearSpace(player, days[currentDay - 1], days, dailyGross);
                    UserInterface.DisplayPass(customer.name);
                }
            }

            player.pitcher.cupsLeftInPitcher = 0;
            UserInterface.DisplayDayResult(cupsSold, dailyGross, days[currentDay - 1], currentDay, player);
        }