Blackjack.Players.BasicStrategyPlayer.DoubleDown C# (CSharp) Method

DoubleDown() public method

public DoubleDown ( HandInfo info ) : bool
info HandInfo
return bool
        public override bool DoubleDown(HandInfo info)
        {
            var hand = info.PlayerHands.ElementAt(info.HandToPlay);
            var value = hand.Value;
            var soft = hand.Soft;
            var dealer = info.DealerHand.Cards.ElementAt(0).Rank;

            if (soft)
            {
                if (value == 18 && dealer == Ranks.Two)
                    return false;

                if (value == 16 && dealer < Ranks.Four)
                    return false;

                if (value > 12 && value < 16 && dealer > Ranks.Four && dealer < Ranks.Seven)
                    return true;

                if (value == 15 && dealer == Ranks.Four)
                    return true;

                if (value == 13 && dealer == Ranks.Five)
                    return true;

                if (value == 13 && dealer == Ranks.Four)
                    return true;

                if (value == 14 && dealer == Ranks.Four)
                    return true;

                if (value == 19 && dealer == Ranks.Six)
                    return true;
            }
            else
            {
                if (value == 8 && dealer > Ranks.Four && dealer < Ranks.Seven)
                    return true;

                if (value == 11)
                    return true;
            }
            return base.DoubleDown(info);
        }