|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soc.message.SOCMessage soc.message.SOCCancelBuildRequest
public class SOCCancelBuildRequest
This message type has five possible meanings, depending on game state and direction sent:
The special inventory items in PLACING_INV_ITEM each have a different placement message, but if item placement
can be canceled, use this common message type, with pieceType
== -3 (INV_ITEM_PLACE_CANCEL
).
If placement can't be canceled, server will reply with SOCGameServerText
.
SOCGameServerText
.
PUTPIECE
(bad building location). Humans can probably
decide a better place to put their road, but robots must cancel
the build request and decide on a new plan.
This can also be the reply if the client sends an illegal BUILDREQUEST
(no resources, not the right game state, etc.).
In that case it's sent only to robot clients, not to humans.
(Humans get a textual error message, and can understand that instead.)
Field Summary | |
---|---|
private java.lang.String |
game
Name of game |
static int |
INV_ITEM_PLACE_CANCEL
pieceType to cancel special SOCInventoryItem placement. |
private int |
pieceType
The type of piece to cancel build, such as SOCPlayingPiece.CITY
-2 is used from server to reject request to buy a Development Card. |
private static long |
serialVersionUID
|
Constructor Summary | |
---|---|
SOCCancelBuildRequest(java.lang.String ga,
int pt)
Create a CancelBuildRequest message. |
Method Summary | |
---|---|
java.lang.String |
getGame()
Name of game this message is for. |
int |
getPieceType()
|
static SOCCancelBuildRequest |
parseDataStr(java.lang.String s)
Parse the command String into a CancelBuildRequest message |
java.lang.String |
toCmd()
CANCELBUILDREQUEST sep game sep2 pieceType |
static java.lang.String |
toCmd(java.lang.String ga,
int pt)
CANCELBUILDREQUEST sep game sep2 pieceType |
java.lang.String |
toString()
Simple human-readable representation, used for debug purposes. |
Methods inherited from class soc.message.SOCMessage |
---|
arrayIntoStringBuf, enumIntoStringBuf, getClassNameShort, getMaximumVersion, getMinimumVersion, 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 |
---|
public static final int INV_ITEM_PLACE_CANCEL
SOCInventoryItem
placement.
private static final long serialVersionUID
private final java.lang.String game
private final int pieceType
SOCPlayingPiece.CITY
-2 is used from server to reject request to buy a Development Card.
-3 (INV_ITEM_PLACE_CANCEL
) is used from client to request canceling placement of a
special SOCInventoryItem if possible.
Constructor Detail |
---|
public SOCCancelBuildRequest(java.lang.String ga, int pt)
ga
- the name of the gamept
- the type of piece to cancel build, such as SOCPlayingPiece.CITY
.
-2 is used from server to reject request to buy a Development Card.
-3 (INV_ITEM_PLACE_CANCEL
) is used from client to request canceling placement of a
special SOCInventoryItem if possible.Method Detail |
---|
public java.lang.String getGame()
SOCMessageForGame
null
if message is in per-game structures or code.
At the server, the message treater dispatches incoming SOCMessageForGame
s
based on their getGame()
:
null
: Message is ignored
SOCMessage.GAME_NONE
: Message is handled by SOCServer
itself
GameHandler
for that game's type. If no game with that name is found,
the message is ignored.
getGame
in interface SOCMessageForGame
SOCMessage.GAME_NONE
public int getPieceType()
SOCPlayingPiece.CITY
.
-2 is used from server to reject request to buy a Development Card.
-3 (INV_ITEM_PLACE_CANCEL
) is used from client to request canceling placement of a
special SOCInventoryItem if possible.public java.lang.String toCmd()
toCmd
in class SOCMessage
public static java.lang.String toCmd(java.lang.String ga, int pt)
ga
- the name of the gamept
- the type of piece to build
public static SOCCancelBuildRequest parseDataStr(java.lang.String s)
s
- the String to parse
public java.lang.String toString()
SOCMessage
toString
in class SOCMessage
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |