示例#1
0
        public ConsoleTable(GameDurak game, List <Player> players)
        {
            this.game = game;
            foreach (var player in players)
            {
                Game.TryConnect(player);
            }

            Game.StartGame();
            Console.WriteLine("\t\t\t The card game \"Durak\" has begun. Good Luck!");

            while (true)
            {
                if (Game.IsFool)
                {
                    break;
                }
                if (Game.IsDraw)
                {
                    break;
                }
                ShowPlayerCards();
                game.MakeMove();
                game.СhangeWhoseTurn();
            }

            Console.Clear();
            if (Game.IsDraw)
            {
                Console.WriteLine("Congratulations, you have a draw");
            }
            if (Game.IsFool)
            {
                Console.WriteLine($"Plaer {Game.Players[0].Name} is Fool");
            }
            Console.WriteLine("If you want to continue click ENTER");
            Console.ReadKey();
            Game.IsDraw = false;
            Game.IsFool = false;
            Program.Main();
        }