|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.blackledge.david.game.solitaire.CardDeck
public class CardDeck
Represents a Deck of cards.
| Constructor Summary | |
|---|---|
CardDeck()
Creates a new Deck of cards containing every card from Card.getMinValue() to Card.getMaxValue() for all 4 suits,
and calls shuffle(). |
|
CardDeck(CardStack cards)
Create a Deck of cards containing the cards in the supplied stack. |
|
| Method Summary | |
|---|---|
CardStack |
draw()
Override for different default draw behavior. |
CardStack |
draw(int num)
Draw the specified number of cards from the deck. |
Card |
get(int i)
get the Card at the specified index, or null if the deck isn't that big. |
Card |
peek()
|
void |
shuffle()
perform a "natural shuffle" 3 times. |
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CardDeck(CardStack cards)
cards - public CardDeck()
Card.getMinValue() to Card.getMaxValue() for all 4 suits,
and calls shuffle().
| Method Detail |
|---|
public void shuffle()
public int size()
public CardStack draw()
draw(int) with a 1.
draw(int)public CardStack draw(int num)
num - the number of cards to (attempt to) draw
size() cards, whichever is smaller, all face up.public Card get(int i)
i -
public Card peek()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||