aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/graphs/NodeList.java
blob: 899384b3d4d6c479dd6a931100b55b9f59c54135 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package gregtech.api.graphs;

// keep track on which node is being looked for across the recursive functions
public class NodeList {

    Node[] mNodes;
    int mCounter = 0;

    public NodeList(Node[] mNodes) {
        this.mNodes = mNodes;
    }

    Node getNextNode() {
        if (++mCounter < mNodes.length) return mNodes[mCounter];
        else return null;
    }

    Node getNode() {
        if (mCounter < mNodes.length) return mNodes[mCounter];
        else return null;
    }
}