Example #1
0
 public Player(int num)
 {
     karts = new DeckСards();
     if (num == 1)
     {
         Console.WriteLine("Введите имя игрока");
         name = Console.ReadLine();
     }
     else
     {
         name = "Computer" + (num - 1).ToString();
     }
 }
Example #2
0
        private DeckСards deckCards;   // колода
        public Game()
        {
            int    playersCount = 0;
            string message      = "Введите количество игроков. 2, 3 или 4.";

            while ((playersCount < MINCOUNTPLAYERS) | (playersCount > MAXCOUNTPLAYERS))
            {
                Console.WriteLine(message);
                playersCount = Int32.Parse(InputValidation(message));
            }
            players = new List <Player>();
            for (int i = 0; i < playersCount; i++)
            {
                players.Add(new Player(i + 1));
            }
            deckCards = new DeckСards();
            deckCards.Unpacking(); // в начале игры сразу распаковываем колоду
            deckCards.Shuffle();   //и перетасовываем колоду
        }