예제 #1
0
파일: NodePort.cs 프로젝트: zeronero13/u
 public static void SetWantsConnection(NodeBase node, NodePort port)
 {
     EncounterNodeGraph.wantsConnection    = true;
     EncounterNodeGraph.connectionNode     = node;
     EncounterNodeGraph.connectionNodePort = port;
 }
예제 #2
0
파일: NodePort.cs 프로젝트: zeronero13/u
 public ConnectionMenuContextObject(NodePort port, string text)
 {
     this.port = port;
     this.text = text;
 }
예제 #3
0
 public NodeBase getNextNodeBackward(NodePort port)
 {
     //VALUES
     return(port.parentNode.parentGraph.connections.getConnectionForPort(port).output.parentNode);
 }
예제 #4
0
 public NodeBase getNextNodeForward(NodePort port)
 {
     //FLOW, IMPULSE
     return(port.parentNode.parentGraph.connections.getConnectionForPort(port).input.parentNode);
 }
예제 #5
0
        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;
        }
예제 #6
0
 public Connection(NodePort output, NodePort input)
 {
     this.output = output;
     this.input  = input;
 }