}
}
/// <summary>
/// Computes the score of the hand
/// </summary>
/// <returns>the value of the score</returns>
public int BlackJackScoreHand()
{
int score = 0;
int aces = 0;
foreach (Card card in this)
{
score += card.BlackJackScore;
if (card.BlackJackScore == 11)
{
aces++;
}
}
while ((score > 21) && (aces > 0))
{
score -= 10;
aces–;
}
return score;
}
}
/// <summary>
/// Contains a number of card decks
/// which can be dealt one at a time.
/// </summary>
public class CardShoe
{
private int noOfDecks = 1;
private byte[] decks;
private int nextCard;
private bool testShoe = false;
/// <summary>
/// True if the deck is "stacked",
/// i.e. was created from a byte array
/// </summary>
public bool TestShoe
{
get
{
return testShoe;
}
}
private void makeShoe()
{
decks = new byte[noOfDecks * 52];