JSettlers v1.0.6 API
Built ${date}

soc.message
Class SOCPlayerElement

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

public class SOCPlayerElement
extends SOCMessage

This message means that someone is joining a game

Author:
Robert S Thomas
See Also:
Serialized Form

Field Summary
static int CITIES
           
static int CLAY
          player element types
static int GAIN
           
static int LOSE
           
static int NUMKNIGHTS
           
static int ORE
           
static int ROADS
           
static int SET
          player element actions
static int SETTLEMENTS
           
static int SHEEP
           
static int UNKNOWN
           
static int WHEAT
           
static int WOOD
           
 
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, RESOURCECOUNT, ROBOTDISMISS, ROLLDICE, ROLLDICEREQUEST, sep, sep2, SERVERPING, SETPLAYEDDEVCARD, SETSEATLOCK, SETTURN, SETUPDONE, SITDOWN, STARTGAME, STATUSMESSAGE, TEXTMSG, TURN, UPDATEROBOTPARAMS
 
Constructor Summary
SOCPlayerElement(java.lang.String ga, int pn, int ac, int et, int va)
          Create a PlayerElement message.
 
Method Summary
 int getAction()
           
 int getElementType()
           
 java.lang.String getGame()
           
 int getPlayerNumber()
           
 int getValue()
           
static SOCPlayerElement parseDataStr(java.lang.String s)
          Parse the command String into a PlayerElement message
 java.lang.String toCmd()
          PLAYERELEMENT sep game sep2 playerNumber sep2 actionType sep2 elementType sep2 value
static java.lang.String toCmd(java.lang.String ga, int pn, int ac, int et, int va)
          PLAYERELEMENT sep game sep2 playerNumber sep2 actionType sep2 elementType sep2 value
 java.lang.String toString()
           
 
Methods inherited from class soc.message.SOCMessage
getType, toMsg
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLAY

public static final int CLAY
player element types

See Also:
Constant Field Values

ORE

public static final int ORE
See Also:
Constant Field Values

SHEEP

public static final int SHEEP
See Also:
Constant Field Values

WHEAT

public static final int WHEAT
See Also:
Constant Field Values

WOOD

public static final int WOOD
See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values

ROADS

public static final int ROADS
See Also:
Constant Field Values

SETTLEMENTS

public static final int SETTLEMENTS
See Also:
Constant Field Values

CITIES

public static final int CITIES
See Also:
Constant Field Values

NUMKNIGHTS

public static final int NUMKNIGHTS
See Also:
Constant Field Values

SET

public static final int SET
player element actions

See Also:
Constant Field Values

GAIN

public static final int GAIN
See Also:
Constant Field Values

LOSE

public static final int LOSE
See Also:
Constant Field Values
Constructor Detail

SOCPlayerElement

public SOCPlayerElement(java.lang.String ga,
                        int pn,
                        int ac,
                        int et,
                        int va)
Create a PlayerElement message.

Parameters:
ga - name of the game
pn - the player number
ac - the type of action
et - the type of element
va - the value of the element
Method Detail

getGame

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

getPlayerNumber

public int getPlayerNumber()
Returns:
the player number

getAction

public int getAction()
Returns:
the action type

getElementType

public int getElementType()
Returns:
the element type

getValue

public int getValue()
Returns:
the element value

toCmd

public java.lang.String toCmd()
PLAYERELEMENT sep game sep2 playerNumber sep2 actionType sep2 elementType sep2 value

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

toCmd

public static java.lang.String toCmd(java.lang.String ga,
                                     int pn,
                                     int ac,
                                     int et,
                                     int va)
PLAYERELEMENT sep game sep2 playerNumber sep2 actionType sep2 elementType sep2 value

Parameters:
ga - the game name
pn - the player number
ac - the type of action
et - the type of element
va - the value of the element
Returns:
the command string

parseDataStr

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

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

toString

public java.lang.String toString()
Returns:
a human readable form of the message

JSettlers v1.0.6 API
Built ${date}