summaryrefslogtreecommitdiff
path: root/src/main/java/net/transit/network/packet/MetaPacket.java
diff options
context:
space:
mode:
authorKyle Gunger <corechg@gmail.com>2020-04-15 15:09:41 -0400
committerKyle Gunger <corechg@gmail.com>2020-04-15 15:09:41 -0400
commitaed6ed909ee81beecac2836cb86654efe29e154b (patch)
tree84405cfa1b58a193335b9a47940fcaaa0ff764f6 /src/main/java/net/transit/network/packet/MetaPacket.java
parent2f8be08dc2d398d71c2325b545e8fc49ca4e214d (diff)
[Update] Version 0.5.1
More documentation, and an updated list of packets
Diffstat (limited to 'src/main/java/net/transit/network/packet/MetaPacket.java')
-rw-r--r--src/main/java/net/transit/network/packet/MetaPacket.java34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/main/java/net/transit/network/packet/MetaPacket.java b/src/main/java/net/transit/network/packet/MetaPacket.java
index 0240519..7e49318 100644
--- a/src/main/java/net/transit/network/packet/MetaPacket.java
+++ b/src/main/java/net/transit/network/packet/MetaPacket.java
@@ -2,32 +2,34 @@ package net.transit.network.packet;
import net.transit.type.Type;
-public class MetaPacket<D, M> implements Packet<D>
+/** Static packet with extra data attached.
+ * @author Kyle Gunger
+ *
+ * @param <D> The data type (Object) that the packet transfers
+ * @param <M> The type of metadata
+*/
+public class MetaPacket<D, M> extends StaticPacket<D>
{
-
- private D data;
private M metaData;
- private Type<D> type;
+ /** Constructor
+ *
+ * @param dat The data to store
+ * @param t The Type of the data
+ * @param meta The metadata to store
+ */
public MetaPacket(D dat, Type<D> t, M meta)
{
- data = dat;
- type = t;
+ super(dat, t);
metaData = meta;
}
-
- public D getData()
- {
- return data;
- }
+ /** Get the metadata of the packet.
+ *
+ * @return The packet's metadata
+ */
public M getMetaData()
{
return metaData;
}
-
- @Override
- public Type<D> getType() {
- return type;
- }
}