|
|
|||||||||
|
||||||||||
|
java.lang.Object
CardGameParticipant
public class CardGameParticipant
extends java.lang.Object
An encapsulation of a participant in a card game
|
|
|
Constructor Summary |
|
|
|
Method Summary |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Methods inherited from class java.lang.Object |
|
protected static final boolean FACE_UP
See Also:
protected static final boolean FACE_DOWN
See Also:
public CardGameParticipant()
Default Constructor
public int howManyUpCardsDoYouHave()
Ask this participant to tell you
how many "face up" cards he/she/it has
Returns:
The number of up cards
public void giveYourCardsBack()
Tell this participant to give back
the cards he/she/it is currently holding
protected Card showMeDownCard(int cardIndex)
Ask this participant to tell show
you a particular "face down" card Children that want to keep their
down cards secret (which is almost always the case) will want to override this
method and return null
Parameters:
cardIndex
- The index number of
the down Card
Returns:
The Card (or null)
public Card showMeUpCard(int cardIndex)
Ask this participant to tell show
you a particular "face up" card
Parameters:
cardIndex
- The index number of
the up Card
Returns:
The Card
public void takeThisCard(Card card,
boolean faceUpOrDown)
Instruct this participant to take a
card and keep it either "face up" or "face down"
Parameters:
card
- The Card
faceUpOrDown
- FACE_UP or
FACE_DOWN
public void playAtTable(Table playAt)
Instruct this participant to play
(or work) at a particular Table
Parameters:
playAt
- The Table to play at
public Player[] whoAreThePlayersAtYourTable()
Ask this participant to give you a
"list" of all of the players at his/her/its Table
Returns:
All of the
Player objects
public Dealer whoIsTheDealerAtYourTable()
Ask this participant to give you
the Dealer at his/her/its Table
Returns:
The Dealer
|
|
|||||||||
|
||||||||||
|