public static bool ValidateHand(string hand)
{
#if DEBUG
if (hand == null) return false;
#endif
int index = 0;
ulong handmask = 0UL;
int cards = 0;
int card = 0;
try
{
for (card = NextCard(hand, ref index); card >= 0; card = NextCard(hand, ref index))
{
if ((handmask & (1UL << card)) != 0)
return false;
handmask |= (1UL << card);
cards++;
}
return card == -1 && cards > 0 && index >= hand.Length;
}
catch
{
return false;
}
}