Ejemplo n.º 1
0
 public void sortHand()
 {
     for (int i = 0; i < cards.Length; i++)
     {
         TCard minCard = cards[i];
         int   minPos  = i;
         for (int j = i; j < cards.Length; j++)
         {
             if (cards[j].suit < minCard.suit)
             {
                 minCard = cards[j];
                 minPos  = j;
             }
             else if (cards[j].suit == minCard.suit)
             {
                 if (cards[j].number < minCard.number)
                 {
                     minCard = cards[j];
                     minPos  = j;
                 }
             }
         }
         TCard tempCard = cards[minPos];
         cards[minPos] = cards[i];
         cards[i]      = tempCard;
     }
 }
Ejemplo n.º 2
0
        public THand(TCard[] cardArray)
        {
            cards = new TCard[13];

            for (int i = 0; i < 13; i++)
            {
                cards[i] = cardArray[i];
            }
        }
Ejemplo n.º 3
0
        public TDeck()
        {
            deckSize = 52;
            cards = new TCard[deckSize];
            numPlayers = 4;
            int cardCount = 0;

            for (int i = 2; i < 15; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    cards[cardCount++] = new TCard(i, j);
                }
            }
        }
Ejemplo n.º 4
0
        public TDeck()
        {
            deckSize   = 52;
            cards      = new TCard[deckSize];
            numPlayers = 4;
            int cardCount = 0;

            for (int i = 2; i < 15; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    cards[cardCount++] = new TCard(i, j);
                }
            }
        }
Ejemplo n.º 5
0
 public void addCard(TCard newCard)
 {
     cards[numCards++] = newCard;
 }
Ejemplo n.º 6
0
 public void addCard(TCard newCard)
 {
     cards[numCards++] = newCard;
 }