Ejemplo n.º 1
0
        //Constructor

        //Member Methods
        public void RunGame()
        {
            bool          restartGameCheck = false;
            List <Player> players          = new List <Player>();
            bool          newGame          = ChooseNewGameOrLoadGame();

            RunNewOrLoadedGame(players, newGame);

            do
            {
                days = new List <Day>();
                for (int i = players[0].loadedCurrentDay; i <= 7; i++)
                {
                    foreach (Player player in players)
                    {
                        if (player.wallet.Money <= 0)
                        {
                            Console.WriteLine($"{player.name} ran out of money!!!");
                            break;
                        }
                        else
                        {
                            currentDay = i;
                            player.loadedCurrentDay = currentDay;
                            InitializeDay(currentDay, player);
                            days[currentDay - 1].GenerateAmountOfCustomers(player);
                            menu.DisplayGameMenu(player, store, days, currentDay, players);
                            SalePhase(days[currentDay - 1], player);
                        }
                    }
                }
                DisplayEndOfGame(players);
                if (UserInterface.CheckStringInput())
                {
                    restartGameCheck = true;
                }
            }while (restartGameCheck == false);
        }