|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jogre.common.playerstate.PlayerState
Class which describes the state of the various player when they join a table. This class employs the STATE design pattern from the GOF (gang of four).
Field Summary | |
static String |
GAME_STARTED
Player is in the middle of a game at a table. |
static String |
READY_TO_START
Player is ready to start a table. |
static String |
SEATED
Player is seated at a table. |
static String |
VIEWING
Player is simply viewing a table. |
Constructor Summary | |
PlayerState()
|
Method Summary | |
abstract boolean |
canOfferDrawResign()
Returns true if a user can offer a draw or resign. |
abstract boolean |
canSit(Table table)
Returns true if a user can sit. |
abstract boolean |
canStand(Table table)
Returns true if a user can stand. |
abstract boolean |
canStart(Table table,
Game game)
Returns true if a user can hit the start. |
abstract PlayerState |
sit()
Abstract method which defines what a player can do when they sit. |
abstract PlayerState |
stand()
Abstract method which defines what a player can do when they stand up. |
abstract PlayerState |
start()
Abstract method which defines what a player can do when they start. |
abstract String |
stringValue()
Integer label of this state (see constants of this class). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String VIEWING
public static final String SEATED
public static final String READY_TO_START
public static final String GAME_STARTED
Constructor Detail |
public PlayerState()
Method Detail |
public abstract PlayerState sit()
public abstract PlayerState stand()
public abstract PlayerState start()
public abstract boolean canSit(Table table)
table
- Link to the table
public abstract boolean canStand(Table table)
table
- Link to the table
public abstract boolean canStart(Table table, Game game)
table
- Link to the tablegame
- Link to the game.
public abstract boolean canOfferDrawResign()
public abstract String stringValue()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |