|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 int |
GAME_STARTED
Player is in the middle of a game at a table. |
static int |
READY_TO_START
Player is ready to start a table. |
static int |
SEATED
Player is seated at a table. |
static int |
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)
Returns true if a user can hit the start. |
abstract int |
intValue()
Integer label of this state (see constants of this class). |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int VIEWING
public static final int SEATED
public static final int READY_TO_START
public static final int 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)
table
- Link to the table
public abstract boolean canOfferDrawResign()
public abstract int intValue()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |