|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 int |
status
Integer status of this comm message. |
protected String |
username
Username of the person who sent this message. |
protected String |
usernameTo
Username of the person who this is being sent to (if empty then no one). |
static String |
XML_ATT_STATUS
Type of message is used to determine which layer the message is for. |
static String |
XML_ATT_USERNAME
|
static String |
XML_ATT_USERNAME_TO
|
Constructor Summary | |
protected |
CommGameMessage()
Constructor with no parameters (no status). |
protected |
CommGameMessage(int status)
Constructor which takes a username and a status. |
|
CommGameMessage(int status,
String username)
Constructor which takes a status and a username to. |
|
CommGameMessage(String username)
Constructor which only takes a username. |
protected |
CommGameMessage(XMLElement message)
Constructor which parses the XMLElement into class fields. |
Method Summary | |
XMLElement |
flatten(String name)
Create a generic (nameless) XMLElement which sub classes can use. |
int |
getStatus()
Return the status. |
String |
getUsername()
Return the optional usernameTo variable. |
String |
getUsernameTo()
Return the optional usernameTo variable. |
boolean |
isUsernameSet()
Return true / false on the username being set. |
boolean |
isUsernameToSet()
Return true / false on the usernameTo being set. |
void |
setUsername(String username)
Set the optional uesrname variable. |
void |
setUsernameTo(String usernameTo)
Set the optional usernameTo variable. |
String |
toString()
Flatten a JOGRE message and indent it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jogre.common.comm.ITransmittable |
flatten |
Field Detail |
protected int status
protected String username
protected String usernameTo
public static final String XML_ATT_STATUS
public static final String XML_ATT_USERNAME
public static final String XML_ATT_USERNAME_TO
Constructor Detail |
protected CommGameMessage()
protected CommGameMessage(int status)
status
- A statuspublic CommGameMessage(String username)
public CommGameMessage(int status, String username)
status
- protected CommGameMessage(XMLElement message)
message
- Element to parse.Method Detail |
public int getStatus()
public void setUsername(String username)
username
- public String getUsername()
public void setUsernameTo(String usernameTo)
usernameTo
- public String getUsernameTo()
public boolean isUsernameSet()
public boolean isUsernameToSet()
public String toString()
Object.toString()
public XMLElement flatten(String name)
name
- Name of the XML element.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |