Class ConsumerNode
The base node for any node that consumes (takes) data. In other words, any node that has one more in ports.
Inherited Members
Namespace: InsaneScatterbrain.ScriptGraph
Syntax
[Serializable]
public abstract class ConsumerNode : ScriptNode, IConsumerNode, IScriptNode, INode
Properties
InPorts
Gets all the in ports.
Declaration
public ReadOnlyCollection<InPort> InPorts { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollection<InPort> |
Node
In case of proxy classes (such as ProcessorNode uses) it's useful to explicitly set the node's type.
Declaration
protected virtual IConsumerNode Node { get; }
Property Value
Type | Description |
---|---|
IConsumerNode |
Methods
AddIn(string, Type, IScriptNode, InPort)
Adds an in port with the given name of the given type.
Declaration
public InPort AddIn(string name, Type type, IScriptNode owner = null, InPort 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). |
InPort | port | The existing port. |
Returns
Type | Description |
---|---|
InPort | The new in port. |
AddIn<T>(string, IScriptNode)
Adds an in port with the given name of the given type.
Declaration
public InPort AddIn<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 |
---|---|
InPort | The new in port. |
Type Parameters
Name | Description |
---|---|
T |
ClearPorts()
Declaration
public void ClearPorts()
GetInPort(string)
Returns the in port with the given name.
Declaration
public InPort GetInPort(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name. |
Returns
Type | Description |
---|---|
InPort | The in port. |
HasInPort(string)
Returns whether the in port with the given name exists on the node.
Declaration
public bool HasInPort(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name. |
Returns
Type | Description |
---|---|
bool | True if the port exists, false otherwise. |
MoveIn(int, int)
Move the in port to a different index
Declaration
public void MoveIn(int oldIndex, int newIndex)
Parameters
Type | Name | Description |
---|---|---|
int | oldIndex | The port's old index. |
int | newIndex | The port's new index. |
OnLoadInputPorts()
This method should contain all the in port initialization code. In other words, it should contain all the AddIn calls for the node.
Declaration
public virtual void OnLoadInputPorts()
RemoveIn(string)
Removes the in port with the given name from the node.
Declaration
public void RemoveIn(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The port's name. |
RenameIn(string, string)
Renames the in port.
Declaration
public void RenameIn(string oldName, string newName)
Parameters
Type | Name | Description |
---|---|---|
string | oldName | The port's old name. |
string | newName | The port's new name. |
Events
OnInPortAdded
Event is triggered everytime an in port is added to the node.
Declaration
public event Action<InPort> OnInPortAdded
Event Type
Type | Description |
---|---|
Action<InPort> |
OnInPortMoved
Event is triggered everytime an in port is moved.
Declaration
public event Action<InPort, int> OnInPortMoved
Event Type
Type | Description |
---|---|
Action<InPort, int> |
OnInPortRemoved
Event is triggered everytime an in port is removed from the node.
Declaration
public event Action<InPort> OnInPortRemoved
Event Type
Type | Description |
---|---|
Action<InPort> |
OnInPortRenamed
Event is triggered everytime an in port is removed from the node.
Declaration
public event Action<InPort, string, string> OnInPortRenamed
Event Type
Type | Description |
---|---|
Action<InPort, string, string> |