mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
71e14259f6
#story[820]
26 lines
691 B
Java
26 lines
691 B
Java
package seng302.models.parsers;
|
|
|
|
/**
|
|
* Created by kre39 on 23/04/17.
|
|
*/
|
|
public class StreamPacket {
|
|
|
|
//Change int to an ENUM for the type
|
|
private PacketType type;
|
|
|
|
private long messageLength;
|
|
private long timeStamp;
|
|
private byte[] payload;
|
|
|
|
public StreamPacket(int type, long messageLength, long timeStamp, byte[] payload) {
|
|
this.type = PacketType.assignPacketType(type);
|
|
this.messageLength = messageLength;
|
|
this.timeStamp = timeStamp;
|
|
this.payload = payload;
|
|
// System.out.println("type = " + type);
|
|
if (this.type == PacketType.BOAT_LOCATION){
|
|
StreamParser.extractBoatLocation(payload);
|
|
}
|
|
}
|
|
}
|