org.jogre.common.comm
Class CommOfferDraw

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

public class CommOfferDraw
extends CommTableMessage

Communications object which is used when one user offers a draw to another user.

Version:
Alpha 0.2.3
Author:
Bob Marks

Field Summary
 
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
CommOfferDraw(int status)
          Constructor which is called from the server and the client who is offering the draw - they are unsure of who the draw is being offered to so the usernameTo (from CommInvite) isn't used.
CommOfferDraw(int status, String username)
          Constructor for a CommOfferDraw object.
CommOfferDraw(XMLElement message)
          Constructor which creates a CommOfferDraw object from the flatten () method of another CommInvite object.
 
Method Summary
 XMLElement flatten()
          Flatten the String.
 
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
 

Constructor Detail

CommOfferDraw

public CommOfferDraw(int status)
Constructor which is called from the server and the client who is offering the draw - they are unsure of who the draw is being offered to so the usernameTo (from CommInvite) isn't used.

Parameters:
status -

CommOfferDraw

public CommOfferDraw(int status,
                     String username)
Constructor for a CommOfferDraw object. This constructor is created from the client. The additional field is the usernameTo.

Parameters:
status - Status of the message i.e. request, accept & decline.

CommOfferDraw

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

Parameters:
message -
Throws:
TransmissionException
Method Detail

flatten

public XMLElement flatten()
Flatten the String.

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