|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jogre.common.comm.CommBaseMessage org.jogre.common.comm.CommGameMessage
This is a message class which goes to a particular game such as chess, checkers etc. The extending class doesn't have to set the game - this is done behind the scenes. The gameID should be the game and version seperated with a colon e.g. chess:0.1
Field Summary | |
protected String |
gameID
Each JOGRE game should have an ID |
static int |
LAYER
Declare this class as a game type of message. |
protected String |
usernameTo
Username of the person who this is being sent to (if empty then no one). |
static String |
XML_ATT_GAME_ID
Game ID. |
Fields inherited from class org.jogre.common.comm.CommBaseMessage |
layer, status, username, XML_ATT_LAYER |
Constructor Summary | |
CommGameMessage()
Empty Constructor. |
|
CommGameMessage(int status)
Call constructor. |
|
CommGameMessage(int status,
String usernameTo)
Constructor which takes a status and a username to. |
|
CommGameMessage(String usernameTo)
Constructor which only takes a usernameTo. |
|
CommGameMessage(XMLElement message)
Constructor which takes an XMLElement from a flatten method of another CommGameMessage object. |
Method Summary | |
XMLElement |
flatten(String name)
Create a generic (nameless) XMLElement which sub classes can use. |
String |
getGameID()
Return the game ID. |
String |
getUsernameTo()
Set the optional usernameTo variable. |
boolean |
isUsernameToSet()
Return true / false on the usernameTo being set. |
void |
setGameID(String gameID)
Set the game ID. |
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 |
Methods inherited from interface org.jogre.common.comm.ITransmittable |
flatten |
Field Detail |
public static final int LAYER
public static final String XML_ATT_GAME_ID
protected String gameID
protected String usernameTo
Constructor Detail |
public CommGameMessage()
public CommGameMessage(int status)
status
- public CommGameMessage(int status, String usernameTo)
status
- usernameTo
- public CommGameMessage(String usernameTo)
usernameTo
- public CommGameMessage(XMLElement message)
message
- Method Detail |
public void setGameID(String gameID)
gameID
- public String getGameID()
public String getUsernameTo()
public boolean isUsernameToSet()
public XMLElement flatten(String name)
flatten
in class CommBaseMessage
name
- Name of the XML element.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |