aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/graphs/paths/NodePath.java
diff options
context:
space:
mode:
authorkorneel vandamme <Krampus.sack.never@gmail.com>2021-06-16 21:25:34 +0200
committerkorneel vandamme <Krampus.sack.never@gmail.com>2021-06-16 21:25:34 +0200
commit3a2bbefb2ba5d29305c8c702cb00574ebc42b713 (patch)
tree80536b2e7ebcb95e9c4ae5d77a75653f113efc13 /src/main/java/gregtech/api/graphs/paths/NodePath.java
parentbadecb827f57cc49d2be89f6135646f77ecd6cbf (diff)
downloadGT5-Unofficial-3a2bbefb2ba5d29305c8c702cb00574ebc42b713.tar.gz
GT5-Unofficial-3a2bbefb2ba5d29305c8c702cb00574ebc42b713.tar.bz2
GT5-Unofficial-3a2bbefb2ba5d29305c8c702cb00574ebc42b713.zip
add graph network to pipes and implement it for power
Diffstat (limited to 'src/main/java/gregtech/api/graphs/paths/NodePath.java')
-rw-r--r--src/main/java/gregtech/api/graphs/paths/NodePath.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/graphs/paths/NodePath.java b/src/main/java/gregtech/api/graphs/paths/NodePath.java
new file mode 100644
index 0000000000..ddbd570af3
--- /dev/null
+++ b/src/main/java/gregtech/api/graphs/paths/NodePath.java
@@ -0,0 +1,29 @@
+package gregtech.api.graphs.paths;
+
+import gregtech.api.metatileentity.BaseMetaPipeEntity;
+import gregtech.api.metatileentity.MetaPipeEntity;
+
+//to contain all info about the path between nodes
+public class NodePath {
+ protected MetaPipeEntity[] mPipes;
+
+ public NodePath(MetaPipeEntity[] aCables) {
+ this.mPipes = aCables;
+ processPipes();
+ }
+
+ public void clearPath() {
+ for (int i = 0; i< mPipes.length; i++) {
+ BaseMetaPipeEntity tBasePipe = (BaseMetaPipeEntity) mPipes[i].getBaseMetaTileEntity();
+ if (tBasePipe != null) {
+ tBasePipe.setNodePath(null);
+ }
+ }
+ }
+ protected void processPipes() {
+ for (MetaPipeEntity tPipe : mPipes) {
+ BaseMetaPipeEntity basePipe = (BaseMetaPipeEntity) tPipe.getBaseMetaTileEntity();
+ basePipe.setNodePath(this);
+ }
+ }
+}