mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
87ef37a689
#refactor #bug #issue[34, 35]
30 lines
747 B
Java
30 lines
747 B
Java
package seng302.gameServer.server.messages;
|
|
|
|
/**
|
|
* Created by kre39 on 12/07/17.
|
|
*/
|
|
public class BoatActionMessage extends Message{
|
|
private final MessageType MESSAGE_TYPE = MessageType.BOAT_ACTION;
|
|
private final int MESSAGE_SIZE = 1;
|
|
private BoatActionType actionType;
|
|
|
|
public BoatActionMessage(BoatActionType actionType) {
|
|
this.actionType = actionType;
|
|
setHeader(new Header(MessageType.BOAT_ACTION, 0, (short) 1)); // the second variable is the source id
|
|
allocateBuffer();
|
|
writeHeaderToBuffer();
|
|
// Write message fields
|
|
putInt(actionType.getValue(), 1);
|
|
writeCRC();
|
|
rewind();
|
|
|
|
}
|
|
|
|
@Override
|
|
public int getSize() {
|
|
return MESSAGE_SIZE;
|
|
}
|
|
|
|
|
|
}
|