コード例 #1
0
        void Round()
        {
            PlaceABet();
            FirstDraw();
            do
            {
                for (int i = 0; i < Player.Hands.Count; i++)
                {
                    if (!Player.Hands[i].Inactive)
                    {
                        if (Player.Hands.Count > 1)
                        {
                            Console.WriteLine("Hand no. {0}|", i);
                            Console.WriteLine("+++++++++++");
                        }
                        PresentOptions();
GetInput:
                        switch (GetInput())
                        {
                        case 1:
                            GameElements.DrawSeparators("-");
                            GetACard(Player, true, i);
                            CheckIfBusted(Player.Hands[i].Cards, i, true);
                            break;

                        case 2:
                            GameElements.DrawSeparators("-");
                            Console.WriteLine("Stand");
                            GameElements.DrawSeparators("-");
                            Player.Hands[i].Inactive = true;
                            break;

                        case 3:
                            if (!Player.DoubleTheBet())
                            {
                                goto GetInput;
                            }
                            GetACard(Player, true, i);
                            CheckIfBusted(Player.Hands[i].Cards, i, true);
                            Player.Hands[i].Inactive = true;
                            break;

                        case 4:
                            if (!Player.Split(i))
                            {
                                goto GetInput;
                            }
                            break;

                        case 5:
                            if (!Croupier.Insurance())
                            {
                                goto GetInput;
                            }
                            break;
                        }
                    }
                    if (CheckIfAllInactive())
                    {
                        if (Croupier.CroupiersMove())
                        {
                            GetACard(Croupier, true, 0);
                            CheckIfBusted(Croupier.Hands[0].Cards, 0, false);
                        }
                        else
                        {
                            Win(i);
                        }
                    }
                }
            } while (!RoundIsOver);
            ShowAllCards(Croupier, 0);
            DisplayCurrentBlance();
        }
コード例 #2
0
 void Reset()
 {
     Croupier    = new Croupier();
     Player      = new Player();
     RoundIsOver = false;
 }