summaryrefslogtreecommitdiff
path: root/src/main/java/net/cshift/transit/basic/AbstractNode.java
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2021-01-16 01:12:04 -0500
committerKyle Gunger <kgunger12@gmail.com>2021-01-16 01:12:04 -0500
commite0a6cfb0aba631d3a1cd27971f87b0d4a677f294 (patch)
treec87a18f10a1cb7b0cab4b278a4b6b424cefcebc7 /src/main/java/net/cshift/transit/basic/AbstractNode.java
parentbfe0005433f5fd84d47a310578e6d4da4cfcc43d (diff)
Update include paths
Diffstat (limited to 'src/main/java/net/cshift/transit/basic/AbstractNode.java')
-rw-r--r--src/main/java/net/cshift/transit/basic/AbstractNode.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/main/java/net/cshift/transit/basic/AbstractNode.java b/src/main/java/net/cshift/transit/basic/AbstractNode.java
new file mode 100644
index 0000000..a87fba4
--- /dev/null
+++ b/src/main/java/net/cshift/transit/basic/AbstractNode.java
@@ -0,0 +1,45 @@
+package net.cshift.transit.basic;
+
+import java.util.*;
+
+import net.cshift.transit.network.system.*;
+import net.minecraft.block.entity.*;
+
+public abstract class AbstractNode extends BlockEntity implements INode {
+
+ public AbstractNode(BlockEntityType<?> type) {
+ super(type);
+ }
+
+ HashMap<String, Object> data = new HashMap<String, Object>();
+ ArrayList<Connection> connections = new ArrayList<Connection>(0);
+
+ @Override
+ public abstract boolean hasGroup(String groupID);
+
+ @Override
+ public ISystem getSystem() {
+ return null;
+ }
+
+ @Override
+ public Object getData(String groupID) {
+ return data.get(groupID);
+ }
+
+ @Override
+ public void setData(Object dat, String groupID) {
+ data.put(groupID, dat);
+ }
+
+ @Override
+ public Connection[] getConnections() {
+ return (Connection[]) connections.toArray();
+ }
+
+ @Override
+ public int connectionCount() {
+ return connections.size();
+ }
+
+}