Exemple #1
0
        //A short function to find the highest card
        public PlayingCard highCard()
        {
            PlayingCard high = new PlayingCard(suite.clubs, value.two);

            for (int i = 0; i < 5; i++)
            {
                if (hand[i].getValue() > high.getValue())
                {
                    high = hand[i];
                }
            }
            return(high);
        }
Exemple #2
0
        //Constructor creates a deck
        //suite and value are enum declared in the Program.cs file
        public Deck()
        {
            topCard  = 0;
            thisDeck = new PlayingCard[52];

            //i increments suite, j increments value
            for (int i = 0, k = 0; i < 4; i++)
            {
                //k is incremnted every time to count off 52 cards
                for (int j = 0; j < 13; j++, k++)
                {
                    thisDeck[k] = new PlayingCard((suite)i, (value)j);
                }
            }
        }