private void constructSortedDeck() { for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { for (int k = 0; k < 3; k++) { for (int l = 0; l < 3; l++) { var card = new Card(i, j, k, l); card.CardSelected += new EventHandler(card_CardSelected); card.CardDeselected += new EventHandler(card_CardDeselected); allCards.Add(card); } } } } }
bool testForSet(Card a, Card b, Card c) { bool sameOrDiff1 = sameOrDifferent(a.Color, b.Color, c.Color); bool sameOrDiff2 = sameOrDifferent(a.Quantity, b.Quantity, c.Quantity); bool sameOrDiff3 = sameOrDifferent(a.Fill, b.Fill, c.Fill); bool sameOrDiff4 = sameOrDifferent(a.Shape, b.Shape, c.Shape); return (sameOrDiff1 && sameOrDiff2 && sameOrDiff3 && sameOrDiff4); }