コード例 #1
0
 public static void GameMenu(string[] playersList, int numberOfPlayers)
 {
     while (true)
     {
         Console.WriteLine($"\nType q - for exit, p - for display the list of players, h - for show history, other input - play round.\n");
         string choose = Console.ReadLine();
         if (choose == "q")
         {
             Console.WriteLine($"Goodbye!");
             File.Delete("../../history.txt");
             Console.ReadLine();
             return;
         }
         else if (choose == "p")
         {
             for (int i = 0; i < playersList.Length; i++)
             {
                 Console.WriteLine($"Player {i + 1}: {playersList[i]};");
             }
         }
         else if (choose == "h")
         {
             Initial_Data.ShowHistory();
         }
         else
         {
             PlayerSelection(playersList, numberOfPlayers);
         }
     }
 }
コード例 #2
0
        public static void PlayerSelection(string[] list, int numberOfPlayers)
        {
            Random random       = new Random();
            string activePlayer = list[random.Next(list.Length - 1)];

            Console.WriteLine($"The next quest will be done by {activePlayer}, and here’s the quest:\n");
            Initial_Data.Quests(activePlayer);
        }
コード例 #3
0
 public static void GameStart()
 {
     Initial_Data.SetPlayersNames(Initial_Data.SetNumberOfPlayers());
 }