Ejemplo n.º 1
0
 public void GoShopping(Store store)
 {
     if (Shopping.GetInput($"{name} would you like to visit the store for supplies? <yes/no>", "yes/no") == "yes")
     {
         Shopping.GoShopping(this, store);
     }
 }
Ejemplo n.º 2
0
        private void SetupHumanPlayers()
        {
            int playerCount;

            playerCount = int.Parse(Shopping.GetInput("select number of players?", "integer greater than 0"));

            for (int i = 0; i < playerCount; i++)
            {
                players.Add(new Human(store));
                players[i].SetPlayerName($"Player {i + 1}");
            }
        }
Ejemplo n.º 3
0
        public void SimulateDay()
        {
            for (int i = 0; i < players.Count; i++)
            {
                Player player = players[i];
                player.DailyReports.Insert(dayNumber, new DailyReport());
                player.DailyReports[dayNumber].InitialBalance         = player.Balance;
                player.DailyReports[dayNumber].EndingBalance          = player.Balance;
                player.DailyReports[dayNumber].PotentialCustomerCount = customers.Count;

                SimulateCustomers(player, i);

                player.Balance = player.DailyReports[dayNumber].EndingBalance;

                Shopping.DisplayPlayerDayResults(player, dayNumber);
            }
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            string Instructions = "Lemonade Stand instructions:\n";

            Instructions = Instructions + " it is multi player game\n";
            Instructions = Instructions + " The basic objective of this game is to buy the materials needed to make lemonade, and then sell it to customers as they walk by during the day. \n";
            Instructions = Instructions + "You are to manage the whole lemonade stand business. \n";
            Instructions = Instructions + "Your job is to first buy the materials such as cups, lemons, cups of sugar and ice. \n";
            Instructions = Instructions + "Secondly, you will need to set the cost per cup of lemonade and the number of lemons, cups of sugar, and ice that will be needed per cup of lemonade..\n";
            Instructions = Instructions + " Then you start the game and people will start to come.  \n";
            Instructions = Instructions + " Feel free to set your prices higher on those hot, muggy days too, as you’ll make more profit, even if you sell a bit less lemonade.\n";
            Instructions = Instructions + "These are changes you might want to consider for the next day of selling your lemonade.\n";
            Instructions = Instructions + "This is just the basic summary of the game; but now lets go in-depth a bit more on each step.\n\n";


            Console.WriteLine(Instructions);
            Game game = new Game();

            do
            {
                game.RunGame();
            }while (Shopping.GetInput("Would you like to play again? <yes/no>", "yes/no") == "yes");
        }
Ejemplo n.º 5
0
        public void RunGame()
        {
            SetupPlayers();

            for (int i = 0; i < numberOfDaysToPlay; i++)
            {
                if (i != 0)
                {
                    days.Add(new Day(random, players, days[i - 1].Forecast, i));
                }
                else
                {
                    days.Add(new Day(random, players, i));
                }
                Shopping.DisplayForecast(days[i].Forecast);
                SendPlayersToStore();
                days[i].SetPlayerRecipes(store.Products);
                days[i].SimulateDay();
            }

            GetFinalScores();
            Shopping.DisplayFinalScores(players, finalScores);
        }
Ejemplo n.º 6
0
 public void DisplayProducts()
 {
     Shopping.DisplayStoreProducts(this);
 }
Ejemplo n.º 7
0
 public void SetRecipe(string playerName)
 {
     Shopping.SetRecipe(this, playerName);
 }
Ejemplo n.º 8
0
 public void DisplayBalance()
 {
     Shopping.DisplayBalance(this);
 }
Ejemplo n.º 9
0
 public void SetPlayerName(string playerLabel)
 {
     Name = Shopping.GetInput($"Enter {playerLabel}'s name:", "string");
 }