Package  

 Class 

Tree 

Deprecated 

Index 

Help 

 

 PREV CLASS   NEXT CLASS

FRAMES    NO FRAMES     All Classes

 

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

 

size=2 width="100%" align=center>

Class CardGameParticipant

java.lang.Object
  extended byCardGameParticipant

public class CardGameParticipant

extends java.lang.Object

An encapsulation of a participant in a card game


Field Summary

protected static boolean

FACE_DOWN
           

protected static boolean

FACE_UP
           

 

Constructor Summary

CardGameParticipant()
          Default Constructor

 

 

Method Summary

 void

giveYourCardsBack()
          Tell this participant to give back the cards he/she/it is currently holding

 int

howManyUpCardsDoYouHave()
          Ask this participant to tell you how many "face up" cards he/she/it has

 void

playAtTable(Table playAt)
          Instruct this participant to play (or work) at a particular Table

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

 Card

showMeUpCard(int cardIndex)
          Ask this participant to tell show you a particular "face up" card

 void

takeThisCard(Card card, boolean faceUpOrDown)
          Instruct this participant to take a card and keep it either "face up" or "face down"

 Player[]

whoAreThePlayersAtYourTable()
          Ask this participant to give you a "list" of all of the players at his/her/its Table

 Dealer

whoIsTheDealerAtYourTable()
          Ask this participant to give you the Dealer at his/her/its Table

 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

FACE_UP

protected static final boolean FACE_UP

See Also:

Constant Field Values


FACE_DOWN

protected static final boolean FACE_DOWN

See Also:

Constant Field Values

Constructor Detail

CardGameParticipant

public CardGameParticipant()

Default Constructor

Method Detail

howManyUpCardsDoYouHave

public int howManyUpCardsDoYouHave()

Ask this participant to tell you how many "face up" cards he/she/it has

Returns:

The number of up cards


giveYourCardsBack

public void giveYourCardsBack()

Tell this participant to give back the cards he/she/it is currently holding


showMeDownCard

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)


showMeUpCard

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


takeThisCard

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


playAtTable

public void playAtTable(Table playAt)

Instruct this participant to play (or work) at a particular Table

Parameters:

playAt - The Table to play at


whoAreThePlayersAtYourTable

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


whoIsTheDealerAtYourTable

public Dealer whoIsTheDealerAtYourTable()

Ask this participant to give you the Dealer at his/her/its Table

Returns:

The Dealer

size=2 width="100%" align=center>

 

Package  

 Class 

Tree 

Deprecated 

Index 

Help 

 

 PREV CLASS   NEXT CLASS

FRAMES    NO FRAMES     All Classes

 

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

 

size=2 width="100%" align=center>