|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsoc.message.SOCMessage
soc.message.SOCMessageMulti
soc.message.SOCMessageTemplateMi
soc.message.SOCPlayerElements
public class SOCPlayerElements
This message from the server holds information on some parts of the player's status,
such as resource type counts. Same structure as SOCPlayerElement
but with
less redundancy when sending multiple messages.
For a given player number and action type, contains multiple
pairs of (element type, value).
Field Summary | |
---|---|
private int |
actionType
Action type: SOCPlayerElement.SET , SOCPlayerElement.GAIN , or SOCPlayerElement.LOSE |
private int[] |
elementTypes
Element types, such as SOCPlayerElement.CLAY , matching
up with each item of values |
static int[] |
NAMED_RESOURCES
The original 5 named resources, for convenience: SOCPlayerElement.CLAY , ORE, SHEEP, WHEAT, SOCPlayerElement.WOOD . |
private int |
playerNumber
Player number |
private static long |
serialVersionUID
|
private int[] |
values
Element values, matching up with each item of elementTypes |
static int |
VERSION
Introduced in version 1.1.09 |
Fields inherited from class soc.message.SOCMessageTemplateMi |
---|
game, pa |
Constructor Summary | |
---|---|
SOCPlayerElements(java.lang.String ga,
int pn,
int ac,
int[] et,
int[] va)
Constructor for server to tell client about player elements. |
Method Summary | |
---|---|
int |
getAction()
|
int[] |
getElementTypes()
|
int |
getMinimumVersion()
Minimum version where this message type is used. |
int |
getPlayerNumber()
|
int[] |
getValues()
|
static SOCPlayerElements |
parseDataStr(java.util.List<java.lang.String> pa)
Parse the command String list into a SOCPlayerElements message. |
Methods inherited from class soc.message.SOCMessageTemplateMi |
---|
getGame, getParams, toCmd, toCmd, toString |
Methods inherited from class soc.message.SOCMessage |
---|
arrayIntoStringBuf, enumIntoStringBuf, getClassNameShort, getMaximumVersion, getType, isSingleLineAndSafe, isSingleLineAndSafe, toMsg |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface soc.message.SOCMessageForGame |
---|
getType |
Field Detail |
---|
private static final long serialVersionUID
public static final int VERSION
public static final int[] NAMED_RESOURCES
SOCPlayerElement.CLAY
, ORE, SHEEP, WHEAT, SOCPlayerElement.WOOD
.
private int playerNumber
private int actionType
SOCPlayerElement.SET
, SOCPlayerElement.GAIN
, or SOCPlayerElement.LOSE
private int[] elementTypes
SOCPlayerElement.CLAY
, matching
up with each item of values
private int[] values
elementTypes
Constructor Detail |
---|
public SOCPlayerElements(java.lang.String ga, int pn, int ac, int[] et, int[] va) throws java.lang.NullPointerException
ga
- name of the gamepn
- the player numberac
- the type of action: SOCPlayerElement.SET
,
SOCPlayerElement.GAIN
, or SOCPlayerElement.LOSE
et
- array of the types of element, such as SOCPlayerElement.SETTLEMENTS
va
- array of the values of each element, corresponding to et[]
java.lang.NullPointerException
- if et null or va nullMethod Detail |
---|
public int getMinimumVersion()
getMinimumVersion
in class SOCMessage
public int getPlayerNumber()
public int getAction()
public int[] getElementTypes()
SOCPlayerElement.CLAY
, matching
up with each item of getValues()
public int[] getValues()
getElementTypes()
public static SOCPlayerElements parseDataStr(java.util.List<java.lang.String> pa)
pa
- the parameters; length 5 or more required.
Built by constructor at server. Length must be odd. pa[0] = gameName pa[1] = playerNum pa[2] = actionType pa[3] = elementType[0] pa[4] = value[0] pa[5] = elementType[1] pa[6] = value[1](etc.)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |