Exemple #1
0
 public Pair(List <Card> cards)
 {
     SortedCards = cards
                   .GroupBy(c => c.CardValue)
                   .SelectMany(group => group)
                   .OrderByDescending(c => c.CardValue == SetOfCardsWithSameValue.WinningValue(cards, 2))
                   .ThenByDescending(c => c.CardValue)
                   .ToList();
 }
Exemple #2
0
 public List <Card> SortCards(List <Card> cards)
 {
     return(cards
            .GroupBy(c => c.CardValue)
            .SelectMany(group => group)
            .OrderByDescending(c => c.CardValue == SetOfCardsWithSameValue.WinningValue(cards, 2))
            .ThenByDescending(c => c.CardValue)
            .ToList());
 }