GR.Gambling.Blackjack.Hand.HasAce C# (CSharp) Method

HasAce() public method

public HasAce ( ) : bool
return bool
        public bool HasAce()
        {
            foreach (Card c in cards)
                if (c.IsAce())
                    return true;
            return false;
        }

Usage Example

        private double GetActionEV(Shoe tmp_shoe, CardSet active_hand, ActionType action, Card dealer_upcard)
        {
            Hand hand = new Hand(active_hand);

            SHand shand;
            int   soft_total = hand.SoftTotal();

            if (soft_total <= 21 && hand.HasAce())
            {
                shand.Total = soft_total;
                shand.Soft  = true;
            }
            else
            {
                shand.Total = hand.HardTotal();
                shand.Soft  = false;
            }

            int[] shoe_counts = tmp_shoe.ToArray();
            int   upcard      = dealer_upcard.PointValue;

            switch (action)
            {
            case ActionType.Stand:

                return(Eval.StandEv(shand, upcard, shoe_counts));

            case ActionType.Hit:

                return(Eval.HitEv(shand, upcard, shoe_counts));

            case ActionType.Double:

                return(Eval.DoubleEv(shand, upcard, current_bet, shoe_counts));

            case ActionType.Split:

                return(Eval.SplitEv(active_hand[0].PointValue, upcard, current_bet, max_splits - split_count, shoe_counts));

            case ActionType.Surrender:

                return(Eval.SurrenderEv());
            }

            return(-1);
        }
All Usage Examples Of GR.Gambling.Blackjack.Hand::HasAce