Exemplo n.º 1
0
        public GameLoop()
        {
            currentDayNumber = 0;
            CreateWeekWeather();
            Player currentPlayer = new Player();

            while (currentDayNumber < 7)
            {
                UserInterface forecastPrompt = new UserInterface();
                forecastPrompt.ForecastToday(forecastTemperatureListGame[currentDayNumber], forecastConditionsGame[currentDayNumber], currentDayNumber);
                currentPlayer.dailyExpenditure = 0;
                currentPlayer.BuyIngredient("Lemons", currentPlayer.currentFunds, currentPlayer.currentInventory);
                currentPlayer.BuyIngredient("Sugar Cubes", currentPlayer.currentFunds, currentPlayer.currentInventory);
                currentPlayer.BuyIngredient("Ice Cubes", currentPlayer.currentFunds, currentPlayer.currentInventory);
                currentPlayer.SetRecipe();
                currentPlayer.SetPitcherCount(currentPlayer.currentInventory, currentPlayer.currentRecipe);
                currentPlayer.SetPrice();
                double dailyExpenditure = currentPlayer.dailyExpenditure;
                Day    newDay           = new Day(currentDayNumber, actualTemperatureListGame[currentDayNumber], actualConditionsGame[currentDayNumber], currentPlayer.currentRecipe, currentPlayer.currentPrice, currentPlayer.pitcherCount);
                currentSales = newDay.salesToday;
                allSales    += currentSales;
                currentPlayer.currentFunds += currentSales;
                currentCrowd = newDay.currentCrowd;
                UserInterface dayResultPrompt = new UserInterface();
                dayResultPrompt.resultsToday(actualTemperatureListGame[currentDayNumber], actualConditionsGame[currentDayNumber], currentCrowd, currentSales, dailyExpenditure);
                currentDayNumber += 1;
                if (currentDayNumber > 6)
                {
                    profits = currentPlayer.currentFunds;
                }
            }
            UserInterface weekResultPrompt = new UserInterface();

            weekResultPrompt.resultsWeek(allSales, profits);
        }