Example #1
0
 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();
 }
Example #2
0
 public int addCardToCount(Card card)
 {
     count += points[getPointValue(card)];
     return count;
 }
Example #3
0
 public int getPointValue(Card card)
 {
     return points[(int)card.CardNumber - 1];
 }