Exemple #1
0
        // CPU Turn
        public static void CPUTurn(Player cpu, Player player)
        {
            Console.Write("\n\n");
            Console.WriteLine("Cards left in the deck: {0}", deck.GetCardsLeft());
            Console.WriteLine();
            DisplayPlayerInfo(cpu);

            if (cpu.Num_Of_Books >= 7 || player.Num_Of_Books >= 7)
            {
                return;
            }

            int   n    = cpu.Num_Of_Cards - 1;
            Faces face = cpu.GetCardAtIndex(n).Face;

            DrawCardIfHandIsEmpty(cpu);

            while (cpu.AskForCards(player, face))
            {
                Console.WriteLine();
                DrawCardIfHandIsEmpty(cpu);
                DisplayFaceTakenFrom(cpu, player, face);
                Console.WriteLine();
                DisplayPlayerInfo(cpu);
                Console.WriteLine();

                if (cpu.Num_Of_Books >= 7 || player.Num_Of_Books >= 7)
                {
                    return;
                }

                n    = 0;
                face = cpu.GetCardAtIndex(n).Face;
            }

            Console.WriteLine();
            GoFish(cpu, player, face);
            Console.WriteLine("\n");
        }