From 04276d1d18d379248cc02b17c15a28760a5adb41 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sat, 22 May 2021 13:36:56 -0400 Subject: 2.0.0 alpha.predev release --- .../transit/network/packet/DynamicPacket.java | 43 +++++++++++++++++++++ .../transit/network/packet/IDynamicPacket.java | 14 +++++++ .../transit/network/packet/MetaDynamicPacket.java | 44 ++++++++++++++++++++++ .../network/packet/dynamic/DynamicPacket.java | 43 --------------------- .../network/packet/dynamic/IDynamicPacket.java | 16 -------- .../network/packet/dynamic/MetaDynamicPacket.java | 44 ---------------------- 6 files changed, 101 insertions(+), 103 deletions(-) create mode 100644 src/main/java/net/cshift/transit/network/packet/DynamicPacket.java create mode 100644 src/main/java/net/cshift/transit/network/packet/IDynamicPacket.java create mode 100644 src/main/java/net/cshift/transit/network/packet/MetaDynamicPacket.java delete mode 100644 src/main/java/net/cshift/transit/network/packet/dynamic/DynamicPacket.java delete mode 100644 src/main/java/net/cshift/transit/network/packet/dynamic/IDynamicPacket.java delete mode 100644 src/main/java/net/cshift/transit/network/packet/dynamic/MetaDynamicPacket.java (limited to 'src/main/java/net/cshift/transit/network/packet') diff --git a/src/main/java/net/cshift/transit/network/packet/DynamicPacket.java b/src/main/java/net/cshift/transit/network/packet/DynamicPacket.java new file mode 100644 index 0000000..60ad177 --- /dev/null +++ b/src/main/java/net/cshift/transit/network/packet/DynamicPacket.java @@ -0,0 +1,43 @@ +package net.cshift.transit.network.packet; + +import net.cshift.transit.type.Type; + +/** + * Simple packet which stores a fluid value. + * + * @author Kyle Gunger + * + * @param The data type (Object) that the packet transfers + */ +public class DynamicPacket implements IDynamicPacket { + private D data; + private Type type; + + /** Constructor. Stores the given data and uses the given type. + * + * @param dat The packet's data + * @param t The packet's type + */ + public DynamicPacket(D dat, Type t) + { + data = dat; + type = t; + } + + @Override + public D getData() + { + return data; + } + + @Override + public void setData(D dat) + { + data = dat; + } + + @Override + public Type getType() { + return type; + } +} diff --git a/src/main/java/net/cshift/transit/network/packet/IDynamicPacket.java b/src/main/java/net/cshift/transit/network/packet/IDynamicPacket.java new file mode 100644 index 0000000..8b7c330 --- /dev/null +++ b/src/main/java/net/cshift/transit/network/packet/IDynamicPacket.java @@ -0,0 +1,14 @@ +package net.cshift.transit.network.packet; + +/** Interface describing a fluid packet. + * @author Kyle Gunger + * + * @param The data type (Object) that the packet transfers + */ +public interface IDynamicPacket extends IStaticPacket{ + /**Set the packet's data. + * + * @return The packet's data + */ + public void setData(D dat); +} diff --git a/src/main/java/net/cshift/transit/network/packet/MetaDynamicPacket.java b/src/main/java/net/cshift/transit/network/packet/MetaDynamicPacket.java new file mode 100644 index 0000000..b87c2ed --- /dev/null +++ b/src/main/java/net/cshift/transit/network/packet/MetaDynamicPacket.java @@ -0,0 +1,44 @@ +package net.cshift.transit.network.packet; + +import net.cshift.transit.type.Type; + +/** Static packet with extra data attached. + * @author Kyle Gunger + * + * @param The data type (Object) that the packet transfers + * @param The type of metadata +*/ +public class MetaDynamicPacket extends DynamicPacket +{ + private M metaData; + + /** Constructor + * + * @param dat The data to store + * @param t The Type of the data + * @param meta The metadata to store + */ + public MetaDynamicPacket(D dat, Type t, M meta) + { + super(dat, t); + metaData = meta; + } + + /** Get the metadata of the packet. + * + * @return The packet's metadata + */ + public M getMetaData() + { + return metaData; + } + + /** Set the metadata of the packet. + * + * @param meta The packet's new metadata + */ + public void setMetaData(M meta) + { + metaData = meta; + } +} diff --git a/src/main/java/net/cshift/transit/network/packet/dynamic/DynamicPacket.java b/src/main/java/net/cshift/transit/network/packet/dynamic/DynamicPacket.java deleted file mode 100644 index d5feb92..0000000 --- a/src/main/java/net/cshift/transit/network/packet/dynamic/DynamicPacket.java +++ /dev/null @@ -1,43 +0,0 @@ -package net.cshift.transit.network.packet.dynamic; - -import net.cshift.transit.type.Type; - -/** - * Simple packet which stores a fluid value. - * - * @author Kyle Gunger - * - * @param The data type (Object) that the packet transfers - */ -public class DynamicPacket implements IDynamicPacket { - private D data; - private Type type; - - /** Constructor. Stores the given data and uses the given type. - * - * @param dat The packet's data - * @param t The packet's type - */ - public DynamicPacket(D dat, Type t) - { - data = dat; - type = t; - } - - @Override - public D getData() - { - return data; - } - - @Override - public void setData(D dat) - { - data = dat; - } - - @Override - public Type getType() { - return type; - } -} diff --git a/src/main/java/net/cshift/transit/network/packet/dynamic/IDynamicPacket.java b/src/main/java/net/cshift/transit/network/packet/dynamic/IDynamicPacket.java deleted file mode 100644 index ffb68a3..0000000 --- a/src/main/java/net/cshift/transit/network/packet/dynamic/IDynamicPacket.java +++ /dev/null @@ -1,16 +0,0 @@ -package net.cshift.transit.network.packet.dynamic; - -import net.cshift.transit.network.packet.IStaticPacket; - -/** Interface describing a fluid packet. - * @author Kyle Gunger - * - * @param The data type (Object) that the packet transfers - */ -public interface IDynamicPacket extends IStaticPacket{ - /**Set the packet's data. - * - * @return The packet's data - */ - public void setData(D dat); -} diff --git a/src/main/java/net/cshift/transit/network/packet/dynamic/MetaDynamicPacket.java b/src/main/java/net/cshift/transit/network/packet/dynamic/MetaDynamicPacket.java deleted file mode 100644 index 9e7d293..0000000 --- a/src/main/java/net/cshift/transit/network/packet/dynamic/MetaDynamicPacket.java +++ /dev/null @@ -1,44 +0,0 @@ -package net.cshift.transit.network.packet.dynamic; - -import net.cshift.transit.type.Type; - -/** Static packet with extra data attached. - * @author Kyle Gunger - * - * @param The data type (Object) that the packet transfers - * @param The type of metadata -*/ -public class MetaDynamicPacket extends DynamicPacket -{ - private M metaData; - - /** Constructor - * - * @param dat The data to store - * @param t The Type of the data - * @param meta The metadata to store - */ - public MetaDynamicPacket(D dat, Type t, M meta) - { - super(dat, t); - metaData = meta; - } - - /** Get the metadata of the packet. - * - * @return The packet's metadata - */ - public M getMetaData() - { - return metaData; - } - - /** Set the metadata of the packet. - * - * @param meta The packet's new metadata - */ - public void setMetaData(M meta) - { - metaData = meta; - } -} -- cgit v1.2.3