Esempio n. 1
0
        /// <summary> Return the output value of the first connected port. Returns null if none found or invalid.</summary>
        /// <returns> <see cref="NodePort.GetOutputValue"/> </returns>
        public object GetInputValue()
        {
            NodePort connectedPort = Connection;

            if (connectedPort == null)
            {
                return(null);
            }
            return(connectedPort.GetOutputValue());
        }
Esempio n. 2
0
 /// <summary> Return the output values of all connected ports. </summary>
 /// <returns> <see cref="NodePort.GetOutputValue"/> </returns>
 public object[] GetInputValues()
 {
     object[] objs = new object[ConnectionCount];
     for (int i = 0; i < ConnectionCount; i++)
     {
         NodePort connectedPort = connections[i].Port;
         if (connectedPort == null)   // if we happen to find a null port, remove it and look again
         {
             connections.RemoveAt(i);
             i--;
             continue;
         }
         objs[i] = connectedPort.GetOutputValue();
     }
     return(objs);
 }