private void WriteAllCards(IEnumerable<Card> enumerable)
{
Card[] allCards = enumerable.ToArray<Card>();
var cardComparer = new CompareCardByType();
Array.Sort(allCards, cardComparer);
for (int index = 0; index < allCards.Length; )
{
Card currentCard = allCards[index];
int cardCount = 0;
do
{
cardCount++;
index++;
} while (index < allCards.Length && cardComparer.Equals(currentCard, allCards[index]));
this.textWriter.Write("{0}({1}), ", currentCard.name, cardCount);
}
this.textWriter.WriteLine();
}