public void Deck() { cards = new Card[CARDS]; for (int suitVal = 0; suitVal < 4; suitVal++) { for (int rankVal = 1; rankVal < 14; rankVal++) { cards[suitVal * 13 + rankVal - 1] = new Card((Suit)suitVal, (Rank)rankVal); } } }
public void Faro() { Card[] firstDeck = new Card[26]; Card[] secondDeck = new Card[26]; Card[] finalDeck = new Card[CARDS]; Array.Copy(cards, 0, firstDeck, 0, 26); Array.Copy(cards, 26, secondDeck, 0, 26); for (int i = 0, j = 0; i < CARDS; i += 2, j++) { cards[i] = firstDeck[j]; cards[i + 1] = secondDeck[j]; } }
public bool Equals(Card other) { return rank == other.rank && suit == other.suit; }