org.jogre.common.comm
Class CommTableAction

java.lang.Object
  extended byorg.jogre.common.comm.CommBaseMessage
      extended byorg.jogre.common.comm.CommGameMessage
          extended byorg.jogre.common.comm.CommTableMessage
              extended byorg.jogre.common.comm.CommTableAction
All Implemented Interfaces:
ITransmittable, ITransmittableWithProps

public class CommTableAction
extends CommTableMessage
implements ITransmittableWithProps

Communication class for performming table actions such as creating a new table, joining an existing table, standing up, being ready-to-start and exitting from a table.

Version:
Alpha 0.2.1
Author:
Bob Marks

Field Summary
static int EXIT
          Exit from a table.
static int JOIN
          Join an existing game.
static int NEW
          Create a new table.
static int NEXT_PLAYER
          Next player
static int READY_TO_START
          Ready to start a game.
static int STAND_UP
          Stand up from a game.
static int START
          Actually start the game.
 
Fields inherited from class org.jogre.common.comm.CommTableMessage
NO_TABLE, omitSender, tableNum, XML_ATT_TABLE_NUM
 
Fields inherited from class org.jogre.common.comm.CommGameMessage
gameID, LAYER, usernameTo, XML_ATT_GAME_ID
 
Fields inherited from class org.jogre.common.comm.CommBaseMessage
layer, status, username, XML_ATT_LAYER
 
Fields inherited from interface org.jogre.common.comm.ITransmittableWithProps
XML_ATT_PROPERTIES
 
Constructor Summary
CommTableAction(boolean isPublic)
          Creating a new table.
CommTableAction(int status)
          Creating a new table.
CommTableAction(int status, boolean isPublic)
          Used for inviting a user.
CommTableAction(XMLElement message)
          Constructor which creates a CommTableAction object from the flatten () method of another CommTableAction object.
 
Method Summary
 void addProperty(String key, String value)
          Add a property to the Table Action.
 XMLElement flatten()
          Flatten the String for transmission purposes.
 JogrePropertyHash getProperties()
          Return the properties hash.
 boolean isPublic()
          Return true / false.
 
Methods inherited from class org.jogre.common.comm.CommTableMessage
flatten, getTableNum, isOmittingSender, setTableNum
 
Methods inherited from class org.jogre.common.comm.CommGameMessage
getGameID, getUsernameTo, isUsernameToSet, setGameID
 
Methods inherited from class org.jogre.common.comm.CommBaseMessage
getStatus, getUsername, setUsername
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEW

public static final int NEW
Create a new table.

See Also:
Constant Field Values

JOIN

public static final int JOIN
Join an existing game.

See Also:
Constant Field Values

STAND_UP

public static final int STAND_UP
Stand up from a game.

See Also:
Constant Field Values

READY_TO_START

public static final int READY_TO_START
Ready to start a game.

See Also:
Constant Field Values

START

public static final int START
Actually start the game.

See Also:
Constant Field Values

NEXT_PLAYER

public static final int NEXT_PLAYER
Next player

See Also:
Constant Field Values

EXIT

public static final int EXIT
Exit from a table.

See Also:
Constant Field Values
Constructor Detail

CommTableAction

public CommTableAction(int status,
                       boolean isPublic)
Used for inviting a user.

Parameters:
status - Status of the message
isPublic - Boolean to specifie if the table is public or not.

CommTableAction

public CommTableAction(int status)
Creating a new table.

Parameters:
status - Status of the message

CommTableAction

public CommTableAction(boolean isPublic)
Creating a new table.

Parameters:
isPublic - boolean to show if a table is public or not.

CommTableAction

public CommTableAction(XMLElement message)
                throws TransmissionException
Constructor which creates a CommTableAction object from the flatten () method of another CommTableAction object.

Parameters:
message - XML element version of object.
Throws:
TransmissionException - Thrown if problem in transmission
Method Detail

isPublic

public boolean isPublic()
Return true / false.

Returns:
True if a public table.

addProperty

public void addProperty(String key,
                        String value)
Add a property to the Table Action.

Specified by:
addProperty in interface ITransmittableWithProps
Parameters:
key -
value -

getProperties

public JogrePropertyHash getProperties()
Description copied from interface: ITransmittableWithProps
Return the properties hash.

Specified by:
getProperties in interface ITransmittableWithProps
Returns:
See Also:
ITransmittableWithProps.getProperties()

flatten

public XMLElement flatten()
Flatten the String for transmission purposes.

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