TexasHoldem.Logic.Cards.Deck.GetNextCard C# (CSharp) Method

GetNextCard() public method

public GetNextCard ( ) : Card
return Card
        public Card GetNextCard()
        {
            if (this.cardIndex == 0)
            {
                throw new InternalGameException("Deck is empty!");
            }

            this.cardIndex--;
            var card = this.listOfCards[this.cardIndex];
            return card;
        }

Usage Example

コード例 #1
0
 public void GetNextCardShouldThrowExceptionWhenCalled53Times()
 {
     IDeck deck = new Deck();
     for (var i = 0; i < 53; i++)
     {
         deck.GetNextCard();
     }
 }
All Usage Examples Of TexasHoldem.Logic.Cards.Deck::GetNextCard