Class Node
An elastic graph node using XNode, that defines how sub-graphs are traversed.
Namespace: Holoride.ElasticSDK.Graph
Assembly: Holoride.ElasticSDK.Runtime.dll
Syntax
[Serializable]
public abstract class Node : Node
Methods
Awake()
Declaration
protected virtual void Awake()
CallRecursive(Action<Node>, ISet<Node>)
Calls the given action on all inputs recursive.
Declaration
public virtual void CallRecursive(Action<Node> action, ISet<Node> visited)
Parameters
Type | Name | Description |
---|---|---|
Action<Node> | action | The action to call on all inputs recursive. |
ISet<Node> | visited | An set that keeps track of whether a node was already visited. |
ForEachOutput<T>(Action<T>)
Calls the given action on all outputs.
Declaration
protected void ForEachOutput<T>(Action<T> action)
Parameters
Type | Name | Description |
---|---|---|
Action<T> | action | The action to call on all outputs. |
Type Parameters
Name | Description |
---|---|
T |
GetInputSourcePorts(string)
Collects all direct and indirect input source ports of this node (i.e. output ports of the nodes connected to the specified input port of this node). Indirect ports are a result of PortalOutputNode<TData, TInputNode>s. In these cases, even if the local XNode.NodePort.ConnectionCount is one, the result may contain multiple ports.
Declaration
public IEnumerable<NodePort> GetInputSourcePorts(string fieldName)
Parameters
Type | Name | Description |
---|---|---|
string | fieldName | The name of the input port to collect connected ports for. |
Returns
Type | Description |
---|---|
IEnumerable<XNode.NodePort> | The list of directly and indirectly connected ports. |
Exceptions
Type | Condition |
---|---|
ArgumentException | If there exists no input port for the specified name. |
GetNodeCategoryType()
Get the base type of this node, defining the logical type category the node belongs to, e.g. MapNode or SpawnerNode.
Declaration
public Type GetNodeCategoryType()
Returns
Type | Description |
---|---|
Type | The logical node category type this node belongs to. |
GetOutputSinkPorts(string)
Collects all direct and indirect output sink ports of this node (i.e. input ports of nodes connected to the specified output port of this node). Indirect ports are a result of PortalInputNode<TData>s. In these cases, even if the local XNode.NodePort.ConnectionCount is one, the result may contain multiple ports.
Declaration
public IEnumerable<NodePort> GetOutputSinkPorts(string fieldName)
Parameters
Type | Name | Description |
---|---|---|
string | fieldName | The name of the output port to collect connected ports for. |
Returns
Type | Description |
---|---|
IEnumerable<XNode.NodePort> | The list of directly and indirectly connected ports. |
Exceptions
Type | Condition |
---|---|
ArgumentException | If there exists no output port for the specified name. |
IsPortOptional(NodePort)
Declaration
public virtual bool IsPortOptional(NodePort port)
Parameters
Type | Name | Description |
---|---|---|
XNode.NodePort | port |
Returns
Type | Description |
---|---|
bool |
TraverseSubGraph()
Traverses the graph and dumps all nodes of a specific type into a list in their traversal order.
Declaration
public List<Node> TraverseSubGraph()
Returns
Type | Description |
---|---|
List<Node> | The list of all nodes in the traversal order. |
XNodePrettyName(Type)
Returns a prettyfied type name according to XNode to be compatible with their settings dictionary. Must be cloned, because their function only works in the editor.
Declaration
public static string XNodePrettyName(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type that's name to prettify. |
Returns
Type | Description |
---|---|
string | The prettified name. |