aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/graphs/paths/NodePath.java
diff options
context:
space:
mode:
authorMartin Robertz <dream-master@gmx.net>2021-07-02 20:52:49 +0200
committerGitHub <noreply@github.com>2021-07-02 20:52:49 +0200
commit2a5b42343509d9684affa6be27da32e9eef89851 (patch)
treec1542a71bf37ed7611aa4cecb6d633556798d01d /src/main/java/gregtech/api/graphs/paths/NodePath.java
parent77c57a97b7286863f9239de806ac9659013d6852 (diff)
parent6f80c03736d6d9ea9c72d19f0af72fc727714370 (diff)
downloadGT5-Unofficial-2a5b42343509d9684affa6be27da32e9eef89851.tar.gz
GT5-Unofficial-2a5b42343509d9684affa6be27da32e9eef89851.tar.bz2
GT5-Unofficial-2a5b42343509d9684affa6be27da32e9eef89851.zip
Merge pull request #572 from GTNewHorizons/beter-power-net
Better power net
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);
+ }
+ }
+}