public bool DoHit(model.Player a_dealer) { // This rule presumes limit of cards is 5 bool isUnderLimit = a_dealer.CalcScore() < g_hitLimit; bool isSoft17 = a_dealer.CalcScore() == g_hitLimit && a_dealer.HasAce(); return(isUnderLimit || isSoft17); }
public bool DoHit(model.Player a_dealer) { // If the sum is between 17 and 20, check if the dealer has an ace. "Soft 17". // Has the dealer 21, wins the dealer. // Has the dealer over 21, CalcScore handles the score for us. int score = a_dealer.CalcScore(); bool hasAce = false; if (score >= g_hitLimit && score < 21) { hasAce = a_dealer.HasAce(); } return(score < g_hitLimit || hasAce); }