public static void SetWantsConnection(NodeBase node, NodePort port) { EncounterNodeGraph.wantsConnection = true; EncounterNodeGraph.connectionNode = node; EncounterNodeGraph.connectionNodePort = port; }
public ConnectionMenuContextObject(NodePort port, string text) { this.port = port; this.text = text; }
public NodeBase getNextNodeBackward(NodePort port) { //VALUES return(port.parentNode.parentGraph.connections.getConnectionForPort(port).output.parentNode); }
public NodeBase getNextNodeForward(NodePort port) { //FLOW, IMPULSE return(port.parentNode.parentGraph.connections.getConnectionForPort(port).input.parentNode); }
public void AddConnection(NodePort output, NodePort input) { //obj == null akkor return; if (((object)output == null) || ((object)input == null)) { return; } //same objects? by reference if (object.ReferenceEquals(output, input)) { return; } // if (output.parentNode.parentGraph.wantsConnection != true) { // return; // } if (EncounterNodeGraph.wantsConnection != true) { return; } if (output.getPortType() != NodePortType.Out) { return; } if (input.getPortType() != NodePortType.In) { return; } if (isConnectionCanBeMade(output, input)) { if (output.getConnectionType() == NodeConnectionType.FLOW) { //Flow outputs only have 1 output line //delete all connection (should be only 1) where this port exist deleteAllConnectionRelatedOutput(output); //add port //connections.Add (new Connection (output, input));//// Connection newConn = new Connection(output, input); connections.Add(newConn); output.occupied = true; input.occupied = true; return; } else if (output.getConnectionType() == NodeConnectionType.IMP) { Connection newConn = new Connection(output, input); connections.Add(newConn); output.occupied = true; input.occupied = true; } else { //BOOL, INT, NUM deleteAllConnectionRelatedInput(input); Connection newConn = new Connection(output, input); connections.Add(newConn); output.occupied = true; input.occupied = true; } } return; }
public Connection(NodePort output, NodePort input) { this.output = output; this.input = input; }