Beispiel #1
0
 public Card Draw()
 {
     if (cards.Count == 0)
     {
         return(null);
     }
     else
     {
         var card = cards[0];
         cards.RemoveAt(0);
         return(card);
     }
 }
Beispiel #2
0
        // Draws (deletes) a number of cards from the Deck
        public Card DrawCard()
        {
            Card drawnCard = null;

            if (Count() != 0)
            {
                drawnCard = cards[0];
                cards.RemoveAt(0);
                if (Count() == 0)
                {
                    drawnCard.LastCard = true;
                }
            }
            else
            {
            }

            return(drawnCard);
        }
Beispiel #3
0
        // Draws (deletes) a number of cards from the Deck
        public Card DrawCard()
        {
            Card drawnCard = null;

            if (Count() != 0)
            {
                drawnCard = cards[0];
                cards.RemoveAt(0);
                if (Count() == 0)
                {
                    //drawnCard.LastCard = true;
                    //for(int i = 0; i > cards.Count(); i++)
                    //{
                    //    cards[i] = cards[i + 1];
                    //}
                    //cards.RemoveAt(cards.Count());
                }
            }
            else
            {
            }

            return(drawnCard);
        }
Beispiel #4
0
 public void RemoveAt(int index)
 {
     Cards.RemoveAt(index);
 }