Пример #1
0
 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);
         }
     }
 }
Пример #2
0
        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];
            }
        }
Пример #3
0
 public bool Equals(Card other)
 {
     return rank == other.rank && suit == other.suit;
 }