Beispiel #1
0
        private void PlayHandUntilDone(PlayerHand hand)
        {
            Hit(hand);

            if (hand.Player.HasMultipleHands)
            {
                ShowCurrentHand(hand, hand.Player);
            }

            var action = Action.None;

            while (!hand.IsBusted && action != Action.Stand)
            {
                action = PlayerNext(hand.Player);
                if (action == Action.Hit)
                {
                    Hit(hand);
                }
            }
            if (action == Action.Stand)
            {
                hand.Stand();
                Draw();
            }
            else if (hand.IsBusted)
            {
                Bust(hand);
            }
        }
Beispiel #2
0
        private void PlayHand(PlayerHand hand)
        {
            if (hand.Player.ActiveHands.Count > 1)
            {
                ShowCurrentHand(hand, hand.Player);
            }

            var action = Action.None;

            if (hand.CanSplit && hand.Player.CanSplit && AskSplit(hand.Player))
            {
                action = Action.Split;
            }
            else
            {
                action = PlayerFirst(hand.Player);
            }

            Draw();

            if (action == Action.Hit)
            {
                PlayHandUntilDone(hand);
            }
            else if (action == Action.Double)
            {
                DoubleDown(hand);
            }
            else if (action == Action.Split)
            {
                Split(hand);
            }
            else if (action == Action.Stand)
            {
                hand.Stand();
                Draw();
            }
        }