org.jogre.common.playerstate
Class PlayerStateSeated

java.lang.Object
  |
  +--org.jogre.common.playerstate.PlayerState
        |
        +--org.jogre.common.playerstate.PlayerStateSeated
All Implemented Interfaces:
ITransmittable

public class PlayerStateSeated
extends PlayerState

State object for a seated player state.

Version:
Alpha 0.1
Author:
Bob Marks

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(PlayerList players)
          Returns true if a user can sit.
 boolean canStand(PlayerList players)
          Once seated a player can stand back up again.
 boolean canStart(PlayerList players)
          A player can start if the minimum number of players are seated or are ready to start.
 String flatten()
          Transmit the player state as an Integer.
 int intValue()
          Integer label of this state (see constants of this class).
 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 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.
Overrides:
stand in class PlayerState
See Also:
PlayerState.stand()

start

public PlayerState start()
Player state goes to ready to start.
Overrides:
start in class PlayerState
See Also:
PlayerState.start()

canStand

public boolean canStand(PlayerList players)
Once seated a player can stand back up again.
Overrides:
canStand in class PlayerState
See Also:
PlayerState.canStand(org.jogre.common.PlayerList)

canStart

public boolean canStart(PlayerList players)
A player can start if the minimum number of players are seated or are ready to start.
Overrides:
canStart in class PlayerState
See Also:
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.
Overrides:
sit in class PlayerState
Following copied from class: org.jogre.common.playerstate.PlayerState
Returns:
PlayerState object.

canSit

public boolean canSit(PlayerList players)
Description copied from class: PlayerState
Returns true if a user can sit.
Overrides:
canSit in class PlayerState
Following copied from class: org.jogre.common.playerstate.PlayerState
Parameters:
players - List of players.
Returns:
 

canOfferDrawResign

public boolean canOfferDrawResign()
Description copied from class: PlayerState
Returns true if a user can offer a draw or resign.
Overrides:
canOfferDrawResign in class PlayerState
Following copied from class: org.jogre.common.playerstate.PlayerState
Returns:
 

flatten

public String flatten()
Transmit the player state as an Integer.
See Also:
ITransmittable.flatten()

intValue

public int intValue()
Description copied from class: PlayerState
Integer label of this state (see constants of this class).
Overrides:
intValue in class PlayerState
See Also:
PlayerState.intValue()

toString

public String toString()
Overrides:
toString in class Object