public HandStatus AddCard(Card card) { if (card.CardNumber == CardNumber.Ace) { if (value < 11) { alternateValue = value + 1; value += 11; } } if (alternateValue != 0 && alternateValue == value) { if (value + (int)card.CardNumber > 21) { value = alternateValue; value += (int)card.CardNumber; alternateValue = 0; } else { value += (int)card.CardNumber; alternateValue += (int)card.CardNumber; } } cards.Add(card); return Evaluate(); }
public int addCardToCount(Card card) { count += points[getPointValue(card)]; return count; }
public int getPointValue(Card card) { return points[(int)card.CardNumber - 1]; }