Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.zazof.jteg
Class RegroupAfterAttackMessage  view RegroupAfterAttackMessage download RegroupAfterAttackMessage.java

java.lang.Object
  extended byorg.zazof.jteg.Message
      extended byorg.zazof.jteg.RegroupAfterAttackMessage

public class RegroupAfterAttackMessage
extends Message

This message "tropas" is received by a client who just won attack, so it knows how many armies it may station on the conquered country.
Message that processes "tropas=" events. This message is valid for following protocols:

Content = "tropas=from_id,to_id,max_nb_armies"


Field Summary
private  int $armies
           
private  int $from
           
private  int $to
           
 
Fields inherited from class org.zazof.jteg.Message
 
Constructor Summary
RegroupAfterAttackMessage(Message nextMessage)
           
 
Method Summary
 java.lang.String constructMessageString(java.lang.String[] messageParts)
          This method will return a Stringrepresentation of a servermessage that corresponds to the different messageParts given as a parameter.
 Message decodeMessage(java.lang.String messageDescription)
          This method will return a Message that correctly processed the string according the active protocol.
 int getFromCountry()
           
 int getMaxArmies()
           
 java.lang.String getMessageName()
          This method returns the name of the message (e.g.
 int getToCountry()
           
 
Methods inherited from class org.zazof.jteg.Message
getNextMessage, hasNextMessage, setNextMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

$from

private int $from

$to

private int $to

$armies

private int $armies
Constructor Detail

RegroupAfterAttackMessage

public RegroupAfterAttackMessage(Message nextMessage)
Method Detail

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

getFromCountry

public int getFromCountry()

getToCountry

public int getToCountry()

getMaxArmies

public int getMaxArmies()