gecco.communication.messages
Class ActionOnPositionMessage
java.lang.Object
|
+--gecco.communication.messages.Message
|
+--gecco.communication.messages.ActionMessage
|
+--gecco.communication.messages.ActionOnPositionMessage
- public class ActionOnPositionMessage
- 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.POSITION
- Author:
- Niklas Hallenfur, Karl Hasselström
Constructor Summary |
ActionOnPositionMessage(long id,
int piece,
String actionhandle,
double x,
double y)
Constructor for the ActionOnPositionMessage object |
Method Summary |
double |
getX()
Gets the X attribute of the ActionOnPositionMessage object |
double |
getY()
Gets the Y attribute of the ActionOnPositionMessage 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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ActionOnPositionMessage
public ActionOnPositionMessage(long id,
int piece,
String actionhandle,
double x,
double y)
- Constructor for the ActionOnPositionMessage object
- Parameters:
id
- Description of Parameterpiece
- Description of Parameteractionhandle
- Description of Parameterx
- Description of Parametery
- Description of Parameter
getX
public double getX()
- Gets the X attribute of the ActionOnPositionMessage object
- Returns:
- The X value
getY
public double getY()
- Gets the Y attribute of the ActionOnPositionMessage object
- Returns:
- The Y 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
.