public static void Initialize(Game game)
{
HandSet playerHands = game.PlayerHandSet;
List<Hand> active = new List<Hand>();
active.Add(playerHands.ActiveHand);
bool allBusted = true;
int numBusted = 0;
foreach (Hand hand in game.PlayerHandSet)
{
if (!hand.Finished)
{
if (hand != playerHands.ActiveHand) active.Add(hand);
}
else
{
if (hand.IsBust())
{
numBusted++;
}
else
{
if (!hand.IsSplit()) allBusted = false;
}
}
}
SHand[] shands = new SHand[active.Count];
for (int i = 0; i < shands.Length; i++)
{
shands[i] = new SHand(active[i]);
}
int[] shoe = game.Shoe.Counts;
shoe[game.DealerHand[1].PointValue - 1]++;
int upcard = game.DealerHand[0].PointValue;
InitializeEvaluation(shands, shands.Length, allBusted, numBusted, upcard, shoe, game.Bet);
}