java.lang.Object
org.zazof.jteg.Message
org.zazof.jteg.NewPlayerMessage
- Direct Known Subclasses:
- NewPlayerMessageProt4
- public class NewPlayerMessage
- extends Message
Message that processes "new_player=" events.
This message is valid for following protocols:
version 3: OK
version 4: NO
version 5: NO
Content = "new_player=player_name,player_number,playercolor"
| Fields inherited from class org.zazof.jteg.Message |
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
$playerName
private java.lang.String $playerName
$playerNumber
private int $playerNumber
$playerColor
private int $playerColor
DEBUG
static final boolean DEBUG
- See Also:
- Constant Field Values
NewPlayerMessage
public NewPlayerMessage(Message nextMessage)
decodeMessage
public Message decodeMessage(java.lang.String messageDescription)
throws UnknownMessageException
- Description copied from class:
Message
- This method will return a Message that correctly processed the string
according the active protocol. If no message was found that could
process the inputstring, an exception is thrown.
The default implementation by message just passes the request on to the next message in the chain.
If other behaviour is desired, this method needs to be overridden.
- Overrides:
decodeMessage in class Message
constructMessageString
public java.lang.String constructMessageString(java.lang.String[] messageParts)
throws UnknownMessageException
- Description copied from class:
Message
- This method will return a Stringrepresentation of a servermessage that corresponds to the
different messageParts given as a parameter. If no correct message could be constructed from the
parts, an exception is thrown.
The default implementation by message just passes the request on to the next message in the chain.
If other behaviour is desired, this method needs to be overridden.
- Overrides:
constructMessageString in class Message
getMessageName
public java.lang.String getMessageName()
- Description copied from class:
Message
- This method returns the name of the message (e.g. 'attaque' or 'loser', ...).
- Specified by:
getMessageName in class Message
getNewPlayerName
public java.lang.String getNewPlayerName()
getNewPlayerNumber
public int getNewPlayerNumber()
getNewPlayerColor
public int getNewPlayerColor()