Class ProviderNode
Base node for any node that provides (gives) data. In other words, any node that has one more out ports.
Inheritance
Inherited Members
Namespace: InsaneScatterbrain.ScriptGraph
Syntax
[Serializable]
public abstract class ProviderNode : ScriptNode, IProviderNode, IScriptNode, INode
Constructors
ProviderNode()
Declaration
protected ProviderNode()
ProviderNode(ScriptGraphGraph)
Declaration
[Obsolete("Processor nodes needn't be dependant on a graph anymore. You can use the parameterless constructor instead. This one will be removed with version 2.0.")]
protected ProviderNode(ScriptGraphGraph graph)
Parameters
| Type | Name | Description |
|---|---|---|
| ScriptGraphGraph | graph |
Properties
Node
In case of proxy classes (such as ProcessorNode uses) it's useful to explicitly set the node's type.
Declaration
protected virtual IProviderNode Node { get; }
Property Value
| Type | Description |
|---|---|
| IProviderNode |
OutPorts
Gets all the out ports.
Declaration
public ReadOnlyCollection<OutPort> OutPorts { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlyCollection<OutPort> |
Methods
AddOut(string, Type, IScriptNode, OutPort)
Adds an out port with the given name of the given type.
Declaration
public OutPort AddOut(string name, Type type, IScriptNode owner = null, OutPort port = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The port's name. |
| Type | type | The port's data type. |
| IScriptNode | owner | The node that is marked as the owner. If this is null that will be this node (which is probably what you want). |
| OutPort | port | The existing port. |
Returns
| Type | Description |
|---|---|
| OutPort | The new out port. |
AddOut<T>(string, IScriptNode)
Adds an out port with the given name of the given type.
Declaration
public OutPort AddOut<T>(string name, IScriptNode owner = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The port's name. |
| IScriptNode | owner | The node that is marked as the owner. If this is null that will be this node (which is probably what you want). |
Returns
| Type | Description |
|---|---|
| OutPort | The new out port. |
Type Parameters
| Name | Description |
|---|---|
| T |
ClearPorts()
Declaration
public void ClearPorts()
GetOutPort(string)
Returns the out port with the given name.
Declaration
public OutPort GetOutPort(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name. |
Returns
| Type | Description |
|---|---|
| OutPort | The out port. |
HasOutPort(string)
Returns whether the out port with the given name exists on the node.
Declaration
public bool HasOutPort(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name. |
Returns
| Type | Description |
|---|---|
| bool | True if the port exists, false otherwise. |
MoveOut(int, int)
Move the out port to a different index
Declaration
public void MoveOut(int oldIndex, int newIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| int | oldIndex | The port's old index. |
| int | newIndex | The port's new index. |
OnLoadOutputPorts()
This method should contain all the out port initialization code. In other words, it should contain all the AddOut calls for the node.
Declaration
public virtual void OnLoadOutputPorts()
RemoveOut(string)
Removes the out port with the given name from the node.
Declaration
public void RemoveOut(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The port's name. |
RenameOut(string, string)
Renames the out port.
Declaration
public void RenameOut(string oldName, string newName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | oldName | The port's old name. |
| string | newName | The port's new name. |
Events
OnOutPortAdded
Event is triggered everytime an out port is added to the node.
Declaration
public event Action<OutPort> OnOutPortAdded
Event Type
| Type | Description |
|---|---|
| Action<OutPort> |
OnOutPortMoved
Event is triggered everytime an in port is moved.
Declaration
public event Action<OutPort, int> OnOutPortMoved
Event Type
| Type | Description |
|---|---|
| Action<OutPort, int> |
OnOutPortRemoved
Event is triggered everytime an in port is removed from the node.
Declaration
public event Action<OutPort> OnOutPortRemoved
Event Type
| Type | Description |
|---|---|
| Action<OutPort> |
OnOutPortRenamed
Event is triggered everytime an in port is removed from the node.
Declaration
public event Action<OutPort, string, string> OnOutPortRenamed
Event Type
| Type | Description |
|---|---|
| Action<OutPort, string, string> |