org.jogre.common.comm
Class CommInvite

java.lang.Object
  extended byorg.jogre.common.comm.CommBaseMessage
      extended byorg.jogre.common.comm.CommGameMessage
          extended byorg.jogre.common.comm.CommInvite
All Implemented Interfaces:
ITransmittable

public class CommInvite
extends CommGameMessage

Communication class which is used to invite a user to a table.

Version:
Alpha 0.2.1
Author:
Bob Marks

Field Summary
static int ACCEPT
          User accepts invite from a user.
static int DECLINE
          User declines invite from.
protected  boolean isPublic
          Boolean to indicate if the table is public or not.
static int REQUEST
          User requests invite to a user.
protected  int tableNum
          Table number.
static int TYPE
          Although this extends CommTableMessage this is a game message.
 
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
 
Constructor Summary
CommInvite(int status, boolean isPublic, int tableNum, String usernameTo)
          Constructor for a CommInvite object which is used to invite a user to a particular table.
CommInvite(XMLElement message)
          Constructor which creates a CommInvite object from the flatten () method of another CommInvite object.
 
Method Summary
 XMLElement flatten()
          Flatten this offer draw object.
 int getTableNum()
          Return the table number.
 String getUsernameTo()
          Return the username to.
 boolean isPublic()
          Return if the table is public or private.
 
Methods inherited from class org.jogre.common.comm.CommGameMessage
flatten, getGameID, 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

TYPE

public static final int TYPE
Although this extends CommTableMessage this is a game message.

See Also:
Constant Field Values

REQUEST

public static final int REQUEST
User requests invite to a user.

See Also:
Constant Field Values

ACCEPT

public static final int ACCEPT
User accepts invite from a user.

See Also:
Constant Field Values

DECLINE

public static final int DECLINE
User declines invite from.

See Also:
Constant Field Values

isPublic

protected boolean isPublic
Boolean to indicate if the table is public or not.


tableNum

protected int tableNum
Table number.

Constructor Detail

CommInvite

public CommInvite(int status,
                  boolean isPublic,
                  int tableNum,
                  String usernameTo)
Constructor for a CommInvite object which is used to invite a user to a particular table.

Parameters:
status - Status of the message i.e. request, accept & decline.
isPublic - Boolean to specifie if the table is public or not.
tableNum - Table number.
usernameTo - The user that is being invited.

CommInvite

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

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

flatten

public XMLElement flatten()
Flatten this offer draw object.

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

isPublic

public boolean isPublic()
Return if the table is public or private.

Returns:
True if public table.

getUsernameTo

public String getUsernameTo()
Return the username to. This is the username of the user of where the message is being sent to.

Overrides:
getUsernameTo in class CommGameMessage
Returns:
Username of person to invite.

getTableNum

public int getTableNum()
Return the table number.

Returns:
Table number.