public static int StraightDrawCount(ulong mask, ulong dead)
{
int retval = 0;
// Get original mask value
Hand.HandTypes origtype = Hand.EvaluateType(mask);
// If current mask better than a straight return then 0 outs
if (origtype >= Hand.HandTypes.Straight)
return retval;
// Look ahead one card
foreach (ulong card in Hand.Hands(0UL, mask | dead, 1))
{
// Get new mask value
Hand.HandTypes newHandType = Hand.EvaluateType(mask | card);
// Include straight flush as this will ensure outs is always the maximum
if (newHandType == Hand.HandTypes.Straight || newHandType == Hand.HandTypes.StraightFlush)
{
retval++;
}
}
return retval;
}