Exemple #1
0
        public void PlayGame()
        {
            Random random = new Random();
            Day    day    = new Day();
            Player player = new Player(0);
            Store  store  = new Store();
            Recipe recipe = new Recipe();

            UserInterface.DisplayRules();
            for (daysPlayed = 0; daysPlayed < 7; daysPlayed++)
            {
                day.weather.GenerateWeatherConditions(random);
                day.weather.MakeForecast();
                UserInterface.DisplayForecast(day);
                UserInterface.DisplayCurrentWeather(day);
                ShowDaysPlayed();
                UserInterface.ShowPlayerStats(player);
                UserInterface.ShowIngredientPrice(store);
                DisplayStore(store, player);
                UserInterface.MakeRecipe(player);
                UserInterface.SetLemonadePrice(recipe);
                day.MakeCustomers(day.weather, recipe, player);
                day.ShowCupsSold(player);
                day.CalculateDayEarnings(player, recipe);
                day.DisplayDayEarnings();
                day.CalculateProfit(player, recipe);
                //calculate the actual profit. Do something with dayProfit and the cost of the ingredients
                day.DisplayPlayerEarnings(player);
                day.AddEarningsToPlayer(player);
                day.ResetDay(player);
            }
            UserInterface.ShowFinalResults(player);
        }
Exemple #2
0
        public virtual void GameLogic()
        {
            Console.WriteLine("Press ENTER TO START");
            Console.ReadLine();
            for (int i = 0; i < daysToPlay; i++)
            {
                ResetDailyValues();
                currentDayNo = i + 1;

                newDay.CreateDayWeather();
                newDay.GenerateCustomers(newDay.dayWeather);
                DisplayDayInventoryScreen();

                myStore.SellCups(player1);
                Console.Clear();
                DisplayDayInventoryScreen();

                myStore.SellLemons(player1);
                Console.Clear();
                DisplayDayInventoryScreen();

                myStore.SellSugar(player1);
                Console.Clear();
                DisplayDayInventoryScreen();

                myStore.SellIce(player1);
                Console.Clear();
                DisplayDayInventoryScreen();

                player1.CreateRecipe(myStore);
                Console.Clear();
                DisplayDayInventoryScreen();

                player1.SetCupPrice();
                Console.Clear();
                DisplayDayInventoryScreen();

                newDay.SellLemonade(player1);
                Console.WriteLine($"Total {newDay.customersDidBuy} customers bought your lemonade today");
                newDay.CalculateProfit(player1);
                DisplayDailyStats();
                Console.ReadLine();
            }
        }