org.jogre.common.playerstate
Class PlayerStateViewing

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

public class PlayerStateViewing
extends PlayerState

State object for a viewing 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
PlayerStateViewing()
           
 
Method Summary
 boolean canOfferDrawResign()
          Returns true if a user can offer a draw or resign.
 boolean canSit(PlayerList players)
          A player can sit if the number of players already seated isn't greater than the maximum number of players allowed in this game.
 boolean canStand(PlayerList players)
          Returns true if a user can stand.
 boolean canStart(PlayerList players)
          Returns true if a user can hit the start.
 String flatten()
          Transmit the player state as an Integer.
 int intValue()
          Integer label of this state (see constants of this class).
 PlayerState sit()
          If a player sits the state changes to seated.
 PlayerState stand()
          Abstract method which defines what a player can do when they stand up.
 PlayerState start()
          Abstract method which defines what a player can do when they start.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlayerStateViewing

public PlayerStateViewing()
Method Detail

sit

public PlayerState sit()
If a player sits the state changes to seated.
Overrides:
sit in class PlayerState
See Also:
PlayerState.sit()

canSit

public boolean canSit(PlayerList players)
A player can sit if the number of players already seated isn't greater than the maximum number of players allowed in this game.
Overrides:
canSit in class PlayerState
See Also:
PlayerState.canSit(org.jogre.common.PlayerList)

stand

public PlayerState stand()
Description copied from class: PlayerState
Abstract method which defines what a player can do when they stand up.
Overrides:
stand in class PlayerState
Following copied from class: org.jogre.common.playerstate.PlayerState
Returns:
PlayerState object.

start

public PlayerState start()
Description copied from class: PlayerState
Abstract method which defines what a player can do when they start.
Overrides:
start in class PlayerState
Following copied from class: org.jogre.common.playerstate.PlayerState
Returns:
PlayerState object.

canStand

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

canStart

public boolean canStart(PlayerList players)
Description copied from class: PlayerState
Returns true if a user can hit the start.
Overrides:
canStart 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