gecco.communication.messages
Class UnitPositionUpdateMessage

java.lang.Object
  |
  +--gecco.communication.messages.Message
        |
        +--gecco.communication.messages.UnitPositionUpdateMessage

public class UnitPositionUpdateMessage
extends Message

This message is put in the send queue on the server part of the communication, when the server calls unitMoved

Author:
Niklas Hallenfur, Karl Hasselström

Field Summary
 int handle
          Description of the Field
 double x
          Description of the Field
 double y
           
 
Constructor Summary
UnitPositionUpdateMessage(int handle, double x, double y)
          Constructor for the UnitPositionUpdateMessage object
 
Method Summary
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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public double x
Description of the Field

y

public double y

handle

public int handle
Description of the Field
Constructor Detail

UnitPositionUpdateMessage

public UnitPositionUpdateMessage(int handle,
                                 double x,
                                 double y)
Constructor for the UnitPositionUpdateMessage object
Parameters:
handle - Description of Parameter
x - Description of Parameter
y - Description of Parameter
Method Detail

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.