org.jogre.common.comm
Class CommOfferDraw

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.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.1
Author:
Bob Marks

Field Summary
 
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
 
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 usernameTo)
          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, 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
 

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 usernameTo)
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.
usernameTo - Username that is being offered the draw to.

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()