gecco.communication.messages
Class ActionOnUnitMessage

java.lang.Object
  |
  +--gecco.communication.messages.Message
        |
        +--gecco.communication.messages.ActionMessage
              |
              +--gecco.communication.messages.ActionOnUnitMessage

public class ActionOnUnitMessage
extends ActionMessage

this message is added to the send queue in the client part of the communication, when the client calls doAction, and the provided Action type is Action.PIECE

Author:
Niklas Hallenfur, Karl Hasselström

Constructor Summary
ActionOnUnitMessage(long id, int exe_piece, String actionhandle, int targetpiece)
          Constructor for the ActionOnUnitMessage object
 
Method Summary
 int getTargetHandle()
          Gets the TargetPieceHandle attribute of the ActionOnUnitMessage object
static Message read(DataInput in)
          This factory method reads a message of this type without an initial ID from the input stream, and returns a Message object.
 void write(DataOutput out)
          This method writes the message to the given DataOutput.
 
Methods inherited from class gecco.communication.messages.ActionMessage
getActionHandle, getHandle, getId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionOnUnitMessage

public ActionOnUnitMessage(long id,
                           int exe_piece,
                           String actionhandle,
                           int targetpiece)
Constructor for the ActionOnUnitMessage object
Parameters:
id - Description of Parameter
exe_piece - Description of Parameter
actionhandle - Description of Parameter
targetpiece - Description of Parameter
Method Detail

getTargetHandle

public int getTargetHandle()
Gets the TargetPieceHandle attribute of the ActionOnUnitMessage object
Returns:
The TargetPieceHandle value

write

public void write(DataOutput out)
           throws IOException
This method writes the message to the given DataOutput.
Overrides:
write in class Message
Parameters:
out - The output stream.
Throws:
IOException - In case something goes wrong.

read

public static Message read(DataInput in)
                    throws IOException
This factory method reads a message of this type without an initial ID from the input stream, and returns a Message object.
Parameters:
in - The input stream.
Returns:
An instance of Message.