示例#1
0
        public void RunGame()
        {
            daysOfTheWeek.Add("Sunday");
            daysOfTheWeek.Add("Monday");
            daysOfTheWeek.Add("Tuesday");
            daysOfTheWeek.Add("Wednesday");
            daysOfTheWeek.Add("Thursday");
            daysOfTheWeek.Add("Friday");
            daysOfTheWeek.Add("Saturday");

            for (int i = 0; i < daysOfTheWeek.Count; i++)
            {
                Console.WriteLine(UserInterface.Rules);
                weather = UserInterface.DisplayWeather(weather);
                player.GoShopping(store);
                Recipe recipe = player.MakeRecipe();
                UserInterface.DisplayRecipe(recipe);
                dailyProfit.Add(profit);
                totalProfit += StartSales(); // cannot call StartSales() method twice
            }

            Console.WriteLine("Total Running Profit: " + totalProfit);
            Console.WriteLine("Sunday profit: " + dailyProfit[0]);
            Console.WriteLine("Monday profit: " + dailyProfit[1]);
            Console.WriteLine("Tueday profit: " + dailyProfit[2]);
            Console.WriteLine("Wednesday profit: " + dailyProfit[3]);
            Console.WriteLine("Thursday profit: " + dailyProfit[4]);
            Console.WriteLine("Friday profit: " + dailyProfit[5]);
            Console.WriteLine("Saturday profit: " + dailyProfit[6]);
        }