org.jogre.common.playerstate
Class PlayerStateSeated

java.lang.Object
  extended byorg.jogre.common.playerstate.PlayerState
      extended byorg.jogre.common.playerstate.PlayerStateSeated

public class PlayerStateSeated
extends PlayerState

State object for a seated player state.

Version:
Alpha 0.2.3
Author:
Bob Marks

Field Summary
 
Fields inherited from class org.jogre.common.playerstate.PlayerState
GAME_STARTED, READY_TO_START, SEATED, VIEWING
 
Constructor Summary
PlayerStateSeated()
           
 
Method Summary
 boolean canOfferDrawResign()
          Returns true if a user can offer a draw or resign.
 boolean canSit(Table table)
          Returns true if a user can sit.
 boolean canStand(Table table)
          Once seated a player can stand back up again.
 boolean canStart(Table table, Game game)
          A player can start if the minimum number of players are seated or are ready to start.
 PlayerState sit()
          Abstract method which defines what a player can do when they sit.
 PlayerState stand()
          If a player stands his state goes back to viewing.
 PlayerState start()
          Player state goes to ready to start.
 String stringValue()
          Integer label of this state (see constants of this class).
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlayerStateSeated

public PlayerStateSeated()
Method Detail

stand

public PlayerState stand()
If a player stands his state goes back to viewing.

Specified by:
stand in class PlayerState
Returns:
PlayerState object.
See Also:
PlayerState.stand()

start

public PlayerState start()
Player state goes to ready to start.

Specified by:
start in class PlayerState
Returns:
PlayerState object.
See Also:
PlayerState.start()

canStand

public boolean canStand(Table table)
Once seated a player can stand back up again.

Specified by:
canStand in class PlayerState
Parameters:
table - Link to the table
Returns:
True if player can stand up.
See Also:
org.jogre.common.playerstate.PlayerState#canStand(org.jogre.common.PlayerList)

canStart

public boolean canStart(Table table,
                        Game game)
A player can start if the minimum number of players are seated or are ready to start.

Specified by:
canStart in class PlayerState
Parameters:
table - Link to the table
game - Link to the game.
Returns:
True if player can start.
See Also:
org.jogre.common.playerstate.PlayerState#canStart(org.jogre.common.PlayerList)

sit

public PlayerState sit()
Description copied from class: PlayerState
Abstract method which defines what a player can do when they sit.

Specified by:
sit in class PlayerState
Returns:
PlayerState object.

canSit

public boolean canSit(Table table)
Description copied from class: PlayerState
Returns true if a user can sit.

Specified by:
canSit in class PlayerState
Parameters:
table - Link to the table
Returns:
True if player can sit down.

canOfferDrawResign

public boolean canOfferDrawResign()
Description copied from class: PlayerState
Returns true if a user can offer a draw or resign.

Specified by:
canOfferDrawResign in class PlayerState
Returns:
True if player offer a draw or resign.

stringValue

public String stringValue()
Description copied from class: PlayerState
Integer label of this state (see constants of this class).

Specified by:
stringValue in class PlayerState
Returns:
String value of this state.
See Also:
org.jogre.common.playerstate.PlayerState#intValue()

toString

public String toString()