Blackjack.BlackjackGame.CanHit C# (CSharp) 메소드

CanHit() 공개 메소드

public CanHit ( PlayerHand hand ) : bool
hand PlayerHand
리턴 bool
        public bool CanHit(PlayerHand hand)
        {
            if (hand.Finished)
                return false;

            if (hand.Value > 21)
                return false;

            //check if the hand split was two aces and if the player is not
            //allowed to hit split aces
            if (hand.HasBeenSplit && !Settings.HittingSplitAcesAllowed && hand.Cards.ElementAt(0).Rank == Ranks.Ace)
                return false;

            return true;
        }