org.jogre.comm
Class CommOfferDraw

java.lang.Object
  |
  +--org.jogre.comm.CommSimpleMessage
        |
        +--org.jogre.comm.CommTableMessage
              |
              +--org.jogre.comm.CommInvite
                    |
                    +--org.jogre.comm.CommOfferDraw
All Implemented Interfaces:
ITransmittable

public class CommOfferDraw
extends CommInvite

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

Version:
Alpha 0.1
Author:
Bob Marks

Field Summary
static String NOT_DEFINED
          Username to is not defined.
 
Fields inherited from class org.jogre.comm.CommInvite
ACCEPT, DECLINE, REQUEST, usernameTo
 
Fields inherited from class org.jogre.comm.CommTableMessage
isPublic, NO_TABLE, tableNum
 
Fields inherited from class org.jogre.comm.CommSimpleMessage
status, username
 
Constructor Summary
CommOfferDraw(String inString)
          Constructor which creates a CommOfferDraw object from the flatten () method of another CommInvite object.
CommOfferDraw(String username, int status, int tableNum)
          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(String username, int status, int tableNum, String usernameTo)
          Constructor for a CommOfferDraw object.
 
Method Summary
 String flatten()
          Flatten the String.
 boolean isPlayerToSet()
          Return true if the playerTo String has been set.
 
Methods inherited from class org.jogre.comm.CommInvite
getUsernameTo
 
Methods inherited from class org.jogre.comm.CommTableMessage
getTableNum, isPublic
 
Methods inherited from class org.jogre.comm.CommSimpleMessage
getStatus, getUsername
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT_DEFINED

public static final String NOT_DEFINED
Username to is not defined.
Constructor Detail

CommOfferDraw

public CommOfferDraw(String username,
                     int status,
                     int tableNum)
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:
username -  
status -  
tableNum -  

CommOfferDraw

public CommOfferDraw(String username,
                     int status,
                     int tableNum,
                     String usernameTo)
Constructor for a CommOfferDraw object. This constructor is created from the client. The additional field is the usernameTo.
Parameters:
username - User who send the CommInvite object.
status - Status of the message i.e. request, accept & decline.
tableNum - Table number of the message.
usernameTo - Username that is being offered the draw to.

CommOfferDraw

public CommOfferDraw(String inString)
              throws TransmissionException
Constructor which creates a CommOfferDraw object from the flatten () method of another CommInvite object.
Parameters:
inString -  
Throws:
TransmissionException -  
Method Detail

isPlayerToSet

public boolean isPlayerToSet()
Return true if the playerTo String has been set.
Returns:
True if playerTo is not equal to NON_DEFINED.

flatten

public String flatten()
Flatten the String.
Overrides:
flatten in class CommInvite
See Also:
ITransmittable.flatten()