org.jogre.common.comm
Class CommPlayerState

java.lang.Object
  extended byorg.jogre.common.comm.CommGameMessage
      extended byorg.jogre.common.comm.CommTableMessage
          extended byorg.jogre.common.comm.CommPlayerState
All Implemented Interfaces:
ITransmittable

public class CommPlayerState
extends CommTableMessage

Communication object for informing the server that the state of a player has been updated.

Version:
Alpha 0.2.3
Author:
Bob Marks

Field Summary
static int NO_SEAT
           
static String XML_ATT_SEAT
           
static String XML_ATT_STATE
           
 
Fields inherited from class org.jogre.common.comm.CommTableMessage
NO_TABLE, tableNum, XML_ATT_TABLE_NUM
 
Fields inherited from class org.jogre.common.comm.CommGameMessage
status, username, usernameTo, XML_ATT_STATUS, XML_ATT_USERNAME, XML_ATT_USERNAME_TO
 
Constructor Summary
CommPlayerState(int table, String player, int seatNum)
          Constructor which takes a table number, a player's name and a seat number (player state is seated).
CommPlayerState(int table, String player, PlayerState state)
          Constructor which takes a table number, a player's name and a state.
CommPlayerState(XMLElement message)
          Constructor which takes an XMLElement.
 
Method Summary
 XMLElement flatten()
          Flatten this to an XMLElement.
 int getSeatNum()
          Return the seat number.
 PlayerState getState()
          Return this state.
 
Methods inherited from class org.jogre.common.comm.CommTableMessage
flatten, getTableNum, setTableNum
 
Methods inherited from class org.jogre.common.comm.CommGameMessage
getStatus, getUsername, getUsernameTo, isUsernameSet, isUsernameToSet, setUsername, setUsernameTo, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_SEAT

public static final int NO_SEAT
See Also:
Constant Field Values

XML_ATT_STATE

public static final String XML_ATT_STATE
See Also:
Constant Field Values

XML_ATT_SEAT

public static final String XML_ATT_SEAT
See Also:
Constant Field Values
Constructor Detail

CommPlayerState

public CommPlayerState(int table,
                       String player,
                       PlayerState state)
Constructor which takes a table number, a player's name and a state.

Parameters:
table - Table number of player.
player - Name of player.
state - State of the player.

CommPlayerState

public CommPlayerState(int table,
                       String player,
                       int seatNum)
Constructor which takes a table number, a player's name and a seat number (player state is seated).

Parameters:
table - Table number of player.
player - Name of player.
seatNum - Seat which player has sat at.

CommPlayerState

public CommPlayerState(XMLElement message)
Constructor which takes an XMLElement.

Parameters:
message - XML version of this method.
Method Detail

getState

public PlayerState getState()
Return this state.

Returns:
State of the player.

getSeatNum

public int getSeatNum()
Return the seat number.

Returns:
Seat number of the player.

flatten

public XMLElement flatten()
Flatten this to an XMLElement.

Returns:
XML version of the state of an object which can be constructed again.
See Also:
ITransmittable.flatten()