Platformer Pro  2.3.2
A platform game kit for Unity.
XNode.NodePort Class Reference

Public Types

enum class  IO { Input , Output }
 

Public Member Functions

 NodePort (FieldInfo fieldInfo)
 Construct a static targetless nodeport. Used as a template. More...
 
 NodePort (NodePort nodePort, Node node)
 Copy a nodePort but assign it to another node. More...
 
 NodePort (string fieldName, Type type, IO direction, Node.ConnectionType connectionType, Node.TypeConstraint typeConstraint, Node node)
 Construct a dynamic port. Dynamic ports are not forgotten on reimport, and is ideal for runtime-created ports. More...
 
void VerifyConnections ()
 Checks all connections for invalid references, and removes them. More...
 
object GetOutputValue ()
 Return the output value of this node through its parent nodes GetValue override method. More...
 
object GetInputValue ()
 Return the output value of the first connected port. Returns null if none found or invalid. More...
 
object[] GetInputValues ()
 Return the output values of all connected ports. More...
 
GetInputValue< T > ()
 Return the output value of the first connected port. Returns null if none found or invalid. More...
 
T[] GetInputValues< T > ()
 Return the output values of all connected ports. More...
 
bool TryGetInputValue< T > (out T value)
 Return true if port is connected and has a valid input. More...
 
float GetInputSum (float fallback)
 Return the sum of all inputs. More...
 
int GetInputSum (int fallback)
 Return the sum of all inputs. More...
 
void Connect (NodePort port)
 Connect this NodePort to another More...
 
List< NodePortGetConnections ()
 
NodePort GetConnection (int i)
 
int GetConnectionIndex (NodePort port)
 Get index of the connection connecting this and specified ports More...
 
bool IsConnectedTo (NodePort port)
 
bool CanConnectTo (NodePort port)
 Returns true if this port can connect to specified port More...
 
void Disconnect (NodePort port)
 Disconnect this port from another port More...
 
void Disconnect (int i)
 Disconnect this port from another port More...
 
void ClearConnections ()
 
List< Vector2 > GetReroutePoints (int index)
 Get reroute points for a given connection. This is used for organization More...
 
void SwapConnections (NodePort targetPort)
 Swap connections with another node More...
 
void AddConnections (NodePort targetPort)
 Copy all connections pointing to a node and add them to this one More...
 
void MoveConnections (NodePort targetPort)
 Move all connections pointing to this node, to another node More...
 
void Redirect (List< Node > oldNodes, List< Node > newNodes)
 Swap connected nodes from the old list with nodes from the new list More...
 

Properties

int ConnectionCount [get]
 
NodePort Connection [get]
 Return the first non-null connection More...
 
IO direction [get]
 
Node.ConnectionType connectionType [get]
 
Node.TypeConstraint typeConstraint [get]
 
bool IsConnected [get]
 Is this port connected to anytihng? More...
 
bool IsInput [get]
 
bool IsOutput [get]
 
string fieldName [get]
 
Node node [get]
 
bool IsDynamic [get]
 
bool IsStatic [get]
 
Type ValueType [get, set]
 

Member Enumeration Documentation

◆ IO

enum XNode.NodePort.IO
strong
Enumerator
Input 
Output 

Constructor & Destructor Documentation

◆ NodePort() [1/3]

XNode.NodePort.NodePort ( FieldInfo  fieldInfo)

Construct a static targetless nodeport. Used as a template.

◆ NodePort() [2/3]

XNode.NodePort.NodePort ( NodePort  nodePort,
Node  node 
)

Copy a nodePort but assign it to another node.

◆ NodePort() [3/3]

XNode.NodePort.NodePort ( string  fieldName,
Type  type,
IO  direction,
Node.ConnectionType  connectionType,
Node.TypeConstraint  typeConstraint,
Node  node 
)

Construct a dynamic port. Dynamic ports are not forgotten on reimport, and is ideal for runtime-created ports.

Member Function Documentation

◆ AddConnections()

void XNode.NodePort.AddConnections ( NodePort  targetPort)

Copy all connections pointing to a node and add them to this one

◆ CanConnectTo()

bool XNode.NodePort.CanConnectTo ( NodePort  port)

Returns true if this port can connect to specified port

◆ ClearConnections()

void XNode.NodePort.ClearConnections ( )

◆ Connect()

void XNode.NodePort.Connect ( NodePort  port)

Connect this NodePort to another

Parameters
portThe NodePort to connect to

◆ Disconnect() [1/2]

void XNode.NodePort.Disconnect ( int  i)

Disconnect this port from another port

◆ Disconnect() [2/2]

void XNode.NodePort.Disconnect ( NodePort  port)

Disconnect this port from another port

◆ GetConnection()

NodePort XNode.NodePort.GetConnection ( int  i)

◆ GetConnectionIndex()

int XNode.NodePort.GetConnectionIndex ( NodePort  port)

Get index of the connection connecting this and specified ports

◆ GetConnections()

List<NodePort> XNode.NodePort.GetConnections ( )

◆ GetInputSum() [1/2]

float XNode.NodePort.GetInputSum ( float  fallback)

Return the sum of all inputs.

Returns
NodePort.GetOutputValue

◆ GetInputSum() [2/2]

int XNode.NodePort.GetInputSum ( int  fallback)

Return the sum of all inputs.

Returns
NodePort.GetOutputValue

◆ GetInputValue()

object XNode.NodePort.GetInputValue ( )

Return the output value of the first connected port. Returns null if none found or invalid.

Returns
NodePort.GetOutputValue

◆ GetInputValue< T >()

Return the output value of the first connected port. Returns null if none found or invalid.

Returns
NodePort.GetOutputValue

◆ GetInputValues()

object [] XNode.NodePort.GetInputValues ( )

Return the output values of all connected ports.

Returns
NodePort.GetOutputValue

◆ GetInputValues< T >()

Return the output values of all connected ports.

Returns
NodePort.GetOutputValue

◆ GetOutputValue()

object XNode.NodePort.GetOutputValue ( )

Return the output value of this node through its parent nodes GetValue override method.

Returns
Node.GetValue(NodePort)

◆ GetReroutePoints()

List<Vector2> XNode.NodePort.GetReroutePoints ( int  index)

Get reroute points for a given connection. This is used for organization

◆ IsConnectedTo()

bool XNode.NodePort.IsConnectedTo ( NodePort  port)

◆ MoveConnections()

void XNode.NodePort.MoveConnections ( NodePort  targetPort)

Move all connections pointing to this node, to another node

◆ Redirect()

void XNode.NodePort.Redirect ( List< Node oldNodes,
List< Node newNodes 
)

Swap connected nodes from the old list with nodes from the new list

◆ SwapConnections()

void XNode.NodePort.SwapConnections ( NodePort  targetPort)

Swap connections with another node

◆ TryGetInputValue< T >()

bool XNode.NodePort.TryGetInputValue< T > ( out T  value)

Return true if port is connected and has a valid input.

Returns
NodePort.GetOutputValue

◆ VerifyConnections()

void XNode.NodePort.VerifyConnections ( )

Checks all connections for invalid references, and removes them.

Property Documentation

◆ Connection

NodePort XNode.NodePort.Connection
get

Return the first non-null connection

◆ ConnectionCount

int XNode.NodePort.ConnectionCount
get

◆ connectionType

Node.ConnectionType XNode.NodePort.connectionType
get

◆ direction

IO XNode.NodePort.direction
get

◆ fieldName

string XNode.NodePort.fieldName
get

◆ IsConnected

bool XNode.NodePort.IsConnected
get

Is this port connected to anytihng?

◆ IsDynamic

bool XNode.NodePort.IsDynamic
get

◆ IsInput

bool XNode.NodePort.IsInput
get

◆ IsOutput

bool XNode.NodePort.IsOutput
get

◆ IsStatic

bool XNode.NodePort.IsStatic
get

◆ node

Node XNode.NodePort.node
get

◆ typeConstraint

Node.TypeConstraint XNode.NodePort.typeConstraint
get

◆ ValueType

Type XNode.NodePort.ValueType
getset

The documentation for this class was generated from the following file: