|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.ninm.games.cardgames.common.DefaultPlayer
The default implementation of a player
| Field Summary | |
private java.util.Set |
m_announcedTricks
|
private java.util.Set |
m_hand
|
private boolean |
m_isDealer
|
private java.lang.String |
m_name
|
private Team |
m_team
|
| Constructor Summary | |
DefaultPlayer(java.lang.String name,
Team team)
|
|
| Method Summary | |
void |
addAnnouncedTrick(Trick trick)
|
void |
addCard(Card card)
adds the card to the hand |
void |
clearTricks()
|
java.util.Set |
getAnnouncedTricks()
returns the tricks announced by the player |
java.util.Set |
getCardsFrom(Suit suit)
retuns all the cards from the specified suit |
java.util.Set |
getHand()
returns the cards currently in this players hand |
java.lang.String |
getName()
returns the name of this player |
Team |
getTeam()
returns the team that this player belongs to |
boolean |
isDealer()
returns true if this player is a dealer |
void |
removeCard(Card card)
removes the card from the hand |
void |
setIsDealer(boolean isDealer)
sets this player dealer status |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private final java.lang.String m_name
private final Team m_team
private java.util.Set m_announcedTricks
private java.util.Set m_hand
private boolean m_isDealer
| Constructor Detail |
public DefaultPlayer(java.lang.String name,
Team team)
| Method Detail |
public boolean isDealer()
Player
isDealer in interface Playerpublic Team getTeam()
Player
getTeam in interface Playerpublic java.lang.String getName()
Player
getName in interface Playerpublic java.util.Set getHand()
Player
getHand in interface Playerpublic java.util.Set getCardsFrom(Suit suit)
suit - the suit that is needed
public void setIsDealer(boolean isDealer)
isDealer - if true then this player is the dealer, false otherwisepublic void addCard(Card card)
card - the card to be addedpublic void removeCard(Card card)
card - public java.util.Set getAnnouncedTricks()
Player
getAnnouncedTricks in interface Playerpublic void addAnnouncedTrick(Trick trick)
public void clearTricks()
public java.lang.String toString()
toString in class java.lang.Object
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||