summaryrefslogtreecommitdiff
path: root/src/main/java/net/cshift/transit/basic
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/cshift/transit/basic')
-rw-r--r--src/main/java/net/cshift/transit/basic/AbstractAcceptorNode.java51
-rw-r--r--src/main/java/net/cshift/transit/basic/AbstractNode.java45
-rw-r--r--src/main/java/net/cshift/transit/basic/AbstractProviderNode.java47
-rw-r--r--src/main/java/net/cshift/transit/basic/AbstractTwoWayNode.java47
4 files changed, 0 insertions, 190 deletions
diff --git a/src/main/java/net/cshift/transit/basic/AbstractAcceptorNode.java b/src/main/java/net/cshift/transit/basic/AbstractAcceptorNode.java
deleted file mode 100644
index e2e6711..0000000
--- a/src/main/java/net/cshift/transit/basic/AbstractAcceptorNode.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package net.cshift.transit.basic;
-
-import net.cshift.transit.network.packet.*;
-import net.cshift.transit.network.system.*;
-import net.cshift.transit.network.system.swap.*;
-import net.minecraft.block.entity.*;
-
-public abstract class AbstractAcceptorNode extends AbstractNode implements IAcceptorNode {
-
- public AbstractAcceptorNode(BlockEntityType<?> type) {
- super(type);
- }
-
- @Override
- public abstract <T> boolean accept(IStaticPacket<T> packet, String group);
-
- @Override
- public boolean linkProvider(IProviderNode requestor, String group) {
- if(this.hasGroup(group))
- {
- for (Connection c : connections) {
- if(c.getNode() == requestor)
- return false;
- }
-
- connections.add(new Connection(requestor, (short) 2));
-
- return true;
- }
-
- return false;
- }
-
- @Override
- public boolean unlinkProvider(IProviderNode requestor) {
- for (Connection c : connections) {
- if(c.getNode() == requestor)
- {
- if(c.isAccepting())
- c.setProviding(false);
- else
- connections.remove(c);
-
- return true;
- }
- }
-
- return false;
- }
-
-}
diff --git a/src/main/java/net/cshift/transit/basic/AbstractNode.java b/src/main/java/net/cshift/transit/basic/AbstractNode.java
deleted file mode 100644
index a87fba4..0000000
--- a/src/main/java/net/cshift/transit/basic/AbstractNode.java
+++ /dev/null
@@ -1,45 +0,0 @@
-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();
- }
-
-}
diff --git a/src/main/java/net/cshift/transit/basic/AbstractProviderNode.java b/src/main/java/net/cshift/transit/basic/AbstractProviderNode.java
deleted file mode 100644
index cc81544..0000000
--- a/src/main/java/net/cshift/transit/basic/AbstractProviderNode.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package net.cshift.transit.basic;
-
-import net.cshift.transit.network.system.*;
-import net.cshift.transit.network.system.swap.*;
-import net.minecraft.block.entity.*;
-
-public abstract class AbstractProviderNode extends AbstractNode implements IProviderNode {
-
- public AbstractProviderNode(BlockEntityType<?> type) {
- super(type);
- }
-
- @Override
- public boolean linkAcceptor(IAcceptorNode requestor, String group) {
- if(this.hasGroup(group))
- {
- for (Connection c : connections) {
- if(c.getNode() == requestor)
- return false;
- }
-
- connections.add(new Connection(requestor, (short) 1));
-
- return true;
- }
-
- return false;
- }
-
- @Override
- public boolean unlinkAcceptor(IAcceptorNode requestor) {
- for (Connection c : connections) {
- if(c.getNode() == requestor)
- {
- if(c.isProviding())
- c.setAccepting(false);
- else
- connections.remove(c);
-
- return true;
- }
- }
-
- return false;
- }
-
-}
diff --git a/src/main/java/net/cshift/transit/basic/AbstractTwoWayNode.java b/src/main/java/net/cshift/transit/basic/AbstractTwoWayNode.java
deleted file mode 100644
index cc06eeb..0000000
--- a/src/main/java/net/cshift/transit/basic/AbstractTwoWayNode.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package net.cshift.transit.basic;
-
-import net.cshift.transit.network.system.*;
-import net.cshift.transit.network.system.swap.*;
-import net.minecraft.block.entity.*;
-
-public abstract class AbstractTwoWayNode extends AbstractAcceptorNode implements IProviderNode {
-
- public AbstractTwoWayNode(BlockEntityType<?> type) {
- super(type);
- }
-
- @Override
- public boolean linkAcceptor(IAcceptorNode requestor, String group) {
- if(this.hasGroup(group))
- {
- for (Connection c : connections) {
- if(c.getNode() == requestor)
- return false;
- }
-
- connections.add(new Connection(requestor, (short) 1));
-
- return true;
- }
-
- return false;
- }
-
- @Override
- public boolean unlinkAcceptor(IAcceptorNode requestor) {
- for (Connection c : connections) {
- if(c.getNode() == requestor)
- {
- if(c.isProviding())
- c.setAccepting(false);
- else
- connections.remove(c);
-
- return true;
- }
- }
-
- return false;
- }
-
-}