Class OutPort
Out ports can be added to nodes as a means to output data from the node.
Implements
Inherited Members
Namespace: InsaneScatterbrain.ScriptGraph
Syntax
[Serializable]
public class OutPort : ScriptGraphPort, ISerializationCallbackReceiver
Properties
ConnectedInPorts
Gets the in ports that this out port is connected to. Returns an empty list if it's unconnected.
Declaration
public ReadOnlyCollection<InPort> ConnectedInPorts { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlyCollection<InPort> |
IsConnected
Return true if this node is connected to another node, false otherwise.
Declaration
public bool IsConnected { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsFlaggedUnconnected
Gets/sets the unconnected flag. If this flag is set to true, the port will be considered to be unconnected, even if it does actually have a connection with another port.
Declaration
public bool IsFlaggedUnconnected { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
Connect(InPort)
Connects this out port to the given in port.
Declaration
public void Connect(InPort inPort)
Parameters
| Type | Name | Description |
|---|---|---|
| InPort | inPort | The in port to connect to. |
Create(string, Type, IScriptNode)
Factory method to create an out port.
Declaration
public static OutPort Create(string name, Type type, IScriptNode owner)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The out port's name. |
| Type | type | The out port's type. |
| IScriptNode | owner | The owning node. Usually the node that it's part of. |
Returns
| Type | Description |
|---|---|
| OutPort | The new out port. |
Disconnect(InPort)
Disconnect this out port from the given in port.
Declaration
public void Disconnect(InPort inPort)
Parameters
| Type | Name | Description |
|---|---|---|
| InPort | inPort | The in port to disconnect from. |
DisconnectAll()
Disconnect all connected in ports from this out port.
Declaration
public void DisconnectAll()
Get()
Gets the data from this port's result provider, which is set through Set. If no result provider has been assigned, null is returned.
Declaration
public object Get()
Returns
| Type | Description |
|---|---|
| object | The data, or null if no result provider is set. |
Get<T>()
Gets the data from this port's result provider, which is set through Set. If no result provider has been assigned, the default value for the port's type will be returned.
Declaration
public T Get<T>()
Returns
| Type | Description |
|---|---|
| T | The data, or the default if no result provider is set. |
Type Parameters
| Name | Description |
|---|---|
| T | The value's type. |
Set(Func<object>)
Sets the result provider, which provides the result for the Get calls.
Declaration
public void Set(Func<object> result)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<object> | result | The result provider. |
Set<T>(Func<T>)
Sets the result provider, which provides the result for the Get calls.
Declaration
public void Set<T>(Func<T> result)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<T> | result | The result provider. |
Type Parameters
| Name | Description |
|---|---|
| T | The type the result provider returns. |