Constructor
new ValueSocket(name, node, type, value)
Construct a new ValueSocket
Parameters:
Name | Type | Default | Description |
---|---|---|---|
name |
string | Name of the socket | |
node |
Node | The parent node | |
type |
Type | The type of this socket | |
value |
any | 0 | The default value of the socket |
- Source:
Classes
Members
(private) canEditName
Some input/output sockets needs to have a name that users can change.
That's because the name of the socket is part of what the user can
choose. Think for example at a node that can make a data structure,
the user will want configure each field of the structure, in terms of
data value and name. The node will have a single output with the structure
as output. In this case the user can select a variable number of input
sockets, and can configure values (or connection) for each input as well
as the name of each socket, that whill be the name of the field in the structure.
This type of socket should be represented as a text field in a UI library.
- Source:
(private) canEditType
Some input/output sockets needs to change their type.
Nodes are responsible to configure this behavior of
sockets during the construction
- Source:
(private) type
The type for the socket's value
- Source:
(private) value
The stored value
- Source:
Methods
clone()
Clone the socket
- Source:
evaluate()
This method evaluates a socket in terms of the real value
that is staying inside. The meaning is different in case of
InputSocket and OutputSocket, that re-defines this method
- Source: