Playing card game method Is there a better, more elegant solution to the following method?

Boolean[] spades = new Boolean[10]; // 40 cards deck

foreach (Card card in m_Cards.Where(card =&gt; (card.Suit == Suit.Spades)))
    spades[(Int32)card.Rank] = true; // Rank goes from Ace (0) to King (10)

if (spades[0] &amp;&amp; spades[1] &amp;&amp; spades[2])
{
    points += 3;

    for (Int32 i = 3; i &lt; spades.Length; ++i)
    {
        if (spades[i])
            ++points;
        else
            break;
    }
}


In fact, the function awards 3 points to the player only if he owns Ace, Two and Three... and, always if this condition is satisfied, it awards him a point for every card that extends the sequence. Examples:

Ace + Three + Five = 0 Points
Ace + Two + Three = 3 Points
Ace + Two + Three + Five = 3 Points
Ace + Two + Three + Four + Five + Six = 6 Points


Every kind of better solution is accepted, such as Linq and enumerable extensions.
We can use the fact that in the ordered sequence of cards the cards that match your requirement will be located at the beginning of sequence, and their rank will match their position:

var count = _cards.Where(card =&gt; card.Suit == Suit.Spades)
    .Select(card =&gt; (int)card.Rank) //we only need the rank
    .Distinct() //ignoring multiple cards with the same rank
    .OrderBy(rank =&gt; rank) //sorting by rank
    .TakeWhile((rank, index) =&gt; rank == index) //taking all initial cards with index matching their rank
    .Count();

return count &lt; 3 ? 0 : count;


Note that your code will perform better than this one (you'll notice that only if you run it thousands times a second) since you're using the fact that there are only 10 sequential values present in Rank.