org.jogre.common.playerstate
Class PlayerStateViewing

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

public class PlayerStateViewing
extends PlayerState

State object for a viewing player state.

Version:
Alpha 0.2.1
Author:
Bob Marks

Field Summary
 
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(Table table)
          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(Table table)
          Returns true if a user can stand.
 boolean canStart(Table table)
          Returns true if a user can hit the start.
 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.

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

canSit

public boolean canSit(Table table)
A player can sit if the number of players already seated isn't greater than the maximum number of players allowed in this game.

Specified by:
canSit in class PlayerState
Parameters:
table - Link to the table
Returns:
True if player can sit down.
See Also:
org.jogre.common.playerstate.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.

Specified by:
stand in class 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.

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

canStand

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

Specified by:
canStand in class PlayerState
Parameters:
table - Link to the table
Returns:
True if player can stand up.

canStart

public boolean canStart(Table table)
Description copied from class: PlayerState
Returns true if a user can hit the start.

Specified by:
canStart in class PlayerState
Parameters:
table - Link to the table
Returns:
True if player can start.

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.

intValue

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

Specified by:
intValue in class PlayerState
Returns:
Integer value of this state.
See Also:
PlayerState.intValue()

toString

public String toString()