mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
aad93d8913
#story[986] #refactor
38 lines
807 B
Java
38 lines
807 B
Java
package seng302.model.stream.packets;
|
|
|
|
/**
|
|
* 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, payload);
|
|
this.messageLength = messageLength;
|
|
this.timeStamp = timeStamp;
|
|
this.payload = payload;
|
|
}
|
|
|
|
public PacketType getType() {
|
|
return type;
|
|
}
|
|
|
|
public long getMessageLength() {
|
|
return messageLength;
|
|
}
|
|
|
|
public byte[] getPayload() {
|
|
return payload;
|
|
}
|
|
|
|
public long getTimeStamp() {
|
|
return timeStamp;
|
|
}
|
|
}
|