public static IList<TwoCards> GetAllCombinationsOfTwoCards(IList<Card> deck) { IList<TwoCards> combinations = new List<TwoCards>(); for (var i = 0; i < deck.Count - 1; i++) { for (var j = i + 1; j < deck.Count; j++) { var twoCards = new TwoCards(deck[i], deck[j]); combinations.Add(twoCards); } } return combinations; }
public static IList <TwoCards> GetAllCombinationsOfTwoCards(IList <Card> deck) { IList <TwoCards> combinations = new List <TwoCards>(); for (var i = 0; i < deck.Count - 1; i++) { for (var j = i + 1; j < deck.Count; j++) { var twoCards = new TwoCards(deck[i], deck[j]); combinations.Add(twoCards); } } return(combinations); }