Пример #1
0
        /*Methods for tunning fields of classes*/
        static void MakeBid(ref Player player)
        {
            while (true) // while we're not entered right bid value
            {
                Console.Write($"Please, make a bid, {player.Name} ");
                PrintAccesibleBids(ref player);

                while (!int.TryParse(Console.ReadLine(), out player.round_bid))
                {
                    Console.WriteLine("Set bid by numeral value!!");
                    Console.Write($"Please, make a bid, {player.Name} ");

                    PrintAccesibleBids(ref player);
                }

                if (player.bidding_points.Contains(player.round_bid) || (player.bidding_points.Count == 0 && player.round_bid == 0))
                {
                    break;
                }

                Console.WriteLine($"You can't make such bid, {player.Name}!");
            }

            Console.Clear();
            ProgramLookout.UpdateProgramLookout();
        }
Пример #2
0
        public static void BiddingProcess(ref Player player1, ref Player player2)
        {
            Console.Clear();
            ProgramLookout.UpdateProgramLookout();
            Console.WriteLine("Now, making bids..\n");

            MakeBid(ref player1);
            ControlTransferMessage();
            MakeBid(ref player2);

            PrintRevealedBids(ref player1, ref player2);
            DefineWinner(ref player1, ref player2);
        }
Пример #3
0
        void PrintField()
        {
            Console.Clear();
            ProgramLookout.UpdateProgramLookout();

            for (int i = 0; i < field_length; i++)
            {
                for (int j = 0; j < field_length; j++)
                {
                    Console.Write(field[i, j] + " ");
                }
                Console.WriteLine();
            }
        }
Пример #4
0
        public void StartProcess()
        {
            ProgramLookout.UpdateProgramLookout();

            PreparePlayers();

            while (current_game == GameState.InProcess)
            {
                Bidding.BiddingProcess(ref player1, ref player2);

                PrintField();

                MakeStep();

                PrintField();

                Console.WriteLine("\nPress any key to continue..");
                Console.ReadKey();

                StepAnalysis.AnalyzeStep(ref field, ref field_length, ref current_game, ref player1.turn);

                if (current_game != GameState.InProcess)
                {
                    if (current_game == GameState.Player1_Win)
                    {
                        PrintCongratulation(ref player1);
                    }
                    else if (current_game == GameState.Ended_Draw)
                    {
                        PrintDrawOutcome();
                    }
                    else
                    {
                        PrintCongratulation(ref player2);
                    }
                }
            }
        }