soc.message
Class SOCGameTextMsg

java.lang.Object
  extended bysoc.message.SOCMessage
      extended bysoc.message.SOCGameTextMsg
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class SOCGameTextMsg
extends SOCMessage

This message contains a text message for a SoC game. Seen by human players on-screen, occasionally parsed by robots if they're expecting something.

Author:
Robert S Thomas
See Also:
Serialized Form

Field Summary
private  java.lang.String game
          Name of game
private  java.lang.String nickname
          Nickname of sender
private static java.lang.String sep2
          our token seperator; not the normal SOCMessage.sep2
private  java.lang.String text
          Text message
 
Fields inherited from class soc.message.SOCMessage
ACCEPTOFFER, ADMINPING, ADMINRESET, BANKTRADE, BCASTTEXTMSG, BOARDLAYOUT, BUILDREQUEST, BUYCARDREQUEST, CANCELBUILDREQUEST, CHANGEFACE, CHANNELS, CHOOSEPLAYER, CHOOSEPLAYERREQUEST, CLEAROFFER, CLEARTRADEMSG, CREATEACCOUNT, DELETECHANNEL, DELETEGAME, DEVCARD, DEVCARDCOUNT, DICERESULT, DISCARD, DISCARDREQUEST, DISCOVERYPICK, ENDTURN, FIRSTPLAYER, GAMEMEMBERS, GAMES, GAMESTATE, GAMESTATS, GAMETEXTMSG, IMAROBOT, JOIN, JOINAUTH, JOINGAME, JOINGAMEAUTH, JOINGAMEREQUEST, LARGESTARMY, LASTSETTLEMENT, LEAVE, LEAVEALL, LEAVEGAME, LONGESTROAD, MAKEOFFER, MEMBERS, messageType, MONOPOLYPICK, MOVEROBBER, NEWCHANNEL, NEWGAME, NULLMESSAGE, PLAYDEVCARDREQUEST, PLAYERELEMENT, POTENTIALSETTLEMENTS, PUTPIECE, REJECTCONNECTION, REJECTOFFER, RESETBOARDAUTH, RESETBOARDREJECT, RESETBOARDREQUEST, RESETBOARDVOTE, RESETBOARDVOTEREQUEST, RESOURCECOUNT, ROBOTDISMISS, ROLLDICE, ROLLDICEPROMPT, ROLLDICEREQUEST, sep, sep_char, sep2_char, SERVERPING, SETPLAYEDDEVCARD, SETSEATLOCK, SETTURN, SETUPDONE, SITDOWN, STARTGAME, STATUSMESSAGE, TEXTMSG, TURN, UPDATEROBOTPARAMS, VERSION
 
Constructor Summary
SOCGameTextMsg(java.lang.String ga, java.lang.String nn, java.lang.String tm)
          Create a GameTextMsg message.
 
Method Summary
 java.lang.String getGame()
           
 java.lang.String getNickname()
           
 java.lang.String getText()
           
static SOCGameTextMsg parseDataStr(java.lang.String s)
          Parse the command String into a GameTextMsg message
 java.lang.String toCmd()
          GAMETEXTMSG sep game sep2 nickname sep2 text
static java.lang.String toCmd(java.lang.String ga, java.lang.String nn, java.lang.String tm)
          GAMETEXTMSG sep game sep2 nickname sep2 text
 java.lang.String toString()
          Simple human-readable representation, used for debug purposes.
 
Methods inherited from class soc.message.SOCMessage
getMaximumVersion, getMinimumVersion, getType, toMsg, toSingleElemArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sep2

private static java.lang.String sep2
our token seperator; not the normal SOCMessage.sep2


game

private java.lang.String game
Name of game


nickname

private java.lang.String nickname
Nickname of sender


text

private java.lang.String text
Text message

Constructor Detail

SOCGameTextMsg

public SOCGameTextMsg(java.lang.String ga,
                      java.lang.String nn,
                      java.lang.String tm)
Create a GameTextMsg message.

Parameters:
ga - name of game
nn - nickname of sender
tm - text message
Method Detail

getGame

public java.lang.String getGame()
Returns:
the name of the game

getNickname

public java.lang.String getNickname()
Returns:
the nickname

getText

public java.lang.String getText()
Returns:
the text message

toCmd

public java.lang.String toCmd()
GAMETEXTMSG sep game sep2 nickname sep2 text

Specified by:
toCmd in class SOCMessage
Returns:
the command String

toCmd

public static java.lang.String toCmd(java.lang.String ga,
                                     java.lang.String nn,
                                     java.lang.String tm)
GAMETEXTMSG sep game sep2 nickname sep2 text

Parameters:
ga - the game name
nn - the nickname
tm - the text message
Returns:
the command string

parseDataStr

public static SOCGameTextMsg parseDataStr(java.lang.String s)
Parse the command String into a GameTextMsg message

Parameters:
s - the String to parse
Returns:
a GameTextMsg message, or null of the data is garbled

toString

public java.lang.String toString()
Description copied from class: SOCMessage
Simple human-readable representation, used for debug purposes.

Specified by:
toString in class SOCMessage
Returns:
a human readable form of the message