//member methods public void RunGame() { Player player = new Player(); store = new Store(); rnd = new Random(); Console.WriteLine("Welcome to Lemonade Stand."); Console.WriteLine("This is a turn based game. Before each turn,"); Console.WriteLine("be sure to check the forecast, update your recipe and cost,"); Console.WriteLine("and buy your ingredients. The weather, cost, and your recipe"); Console.WriteLine("will affect sales, so play wisely. "); Console.WriteLine("After your buy ingredients and change your recipe, type 'go' to start your day."); for (int i = 0; i < numberOfTurns; i++) { Day day = new Day(rnd); days.Add(day); } for (int i = 0; i < days.Count; i++) { Console.WriteLine("Day {0}:", GameDay); days[i].DisplayForecast(days[i].Weather); option = ""; while (!ready) { Console.WriteLine("What would you like to do? Enter a keyword:'forecast' 'recipe', 'store', 'price', 'go'"); switch (Console.ReadLine()) { case "forecast": Weather.DisplayWeeklyForecast(days); break; case "store": store.RunStore(player); break; case "recipe": player.Recipe.SetRecipe(userInterface, player); break; case "go": ready = true; break; case "price": Console.WriteLine("What would you like the price per cup of your lemonade to be?"); player.Recipe.Price = userInterface.GetUserDecimalInput(); break; default: Console.WriteLine("Sorry, '{0}' is not a valid entry. Try again.", option); option = userInterface.GetUserInput(); break; } } ready = false; score += days[i].RunDay(days[i].Weather, rnd, player); //Day day = new Day(rnd); GameDay++; //Display Details Console.WriteLine("{0}'s Net Profit: ${1}", player.Name, score); } DatabaseConnection db = new DatabaseConnection(); db.OpenConnection(); db.ExecuteQueries("INSERT INTO lemonadestand.HighScores VALUES ('" + player.Name + "', " + Score + ");"); db.CloseConnection(); }