EasyTalk API
Loading...
Searching...
No Matches
EasyTalk.Nodes.Core.Node Class Reference

A base implementation of a dialogue node, from which all other nodes are derived. More...

Inherited by EasyTalk.Nodes.Common.EntryNode, EasyTalk.Nodes.Common.ExitNode, EasyTalk.Nodes.Common.OptionModifierNode, EasyTalk.Nodes.Common.StoryNode, EasyTalk.Nodes.Core.ListNode, EasyTalk.Nodes.Flow.JumpInNode, EasyTalk.Nodes.Flow.JumpOutNode, EasyTalk.Nodes.Flow.PauseNode, EasyTalk.Nodes.Flow.WaitNode, EasyTalk.Nodes.Logic.CompareNumbersNode, EasyTalk.Nodes.Logic.CompareStringsNode, EasyTalk.Nodes.Logic.ConditionalValueNode, EasyTalk.Nodes.Logic.LogicNode, EasyTalk.Nodes.Logic.MathNode, EasyTalk.Nodes.Logic.TriggerScriptNode, EasyTalk.Nodes.Variable.GetVariableNode, EasyTalk.Nodes.Variable.SetVariableNode, and EasyTalk.Nodes.Variable.VariableNode.

Public Member Functions

void AddInput (NodeConnection input)
 Adds the provided input connection to the node's inputs.
 
void AddOutput (NodeConnection output)
 Adds the provided output connection to the node's outputs.
 
NodeConnection AddInput (InputOutputType connectionType)
 Adds a new input connection of the specified type to the node's inputs.
 
NodeConnection AddOutput (InputOutputType connectionType)
 Adds a new output connection of the specified type to the node's outputs.
 
NodeConnection FindOutputOfType (InputOutputType outputType)
 Finds the first output which matches the specified output type.
 
NodeConnection FindInputOfType (InputOutputType inputType)
 Finds the first input which matches the specified input type.
 
bool HasConnectedInputs ()
 Returns true if this node has inputs which are connected to other node outputs.
 
bool HasConnectedOutputs ()
 Returns true if this node has outputs which are connected to other node inputs.
 
List< int > FindDependencyOutputIDs ()
 Finds and returns a List of all output IDs which are connected to this node's value (non-dialogue-flow) inputs.
 
string GetJSON ()
 Returns a JSON string representation of the node.
 

Static Public Member Functions

static Node Deserialize (string json)
 Deserializes a Node from the specified JSON string.
 

Protected Member Functions

List< NodeConnectionFindFlowInputs ()
 Finds and returns a List of all inputs which are dialogue flow inputs.
 
List< NodeConnectionFindFlowOutputs ()
 Finds and returns a List of all outputs which are dialogue flow outputs.
 

Protected Attributes

int nodeId = NodeUtils.NextID()
 The ID of the node.
 
string name
 The name of the node.
 
NodeType nodeType
 The type of the node.
 
List< NodeConnectioninputs = new List<NodeConnection>()
 A List of input connections of the node.
 
List< NodeConnectionoutputs = new List<NodeConnection>()
 A List of output connections of the node.
 

Properties

int ID [get, set]
 Gets or sets the node ID.
 
string NodeTypeString [get, set]
 Gets or sets the node type string.
 
float XPosition [get, set]
 Gets or sets the X position of the node.
 
float YPosition [get, set]
 Gets or sets the Y position of the node.
 
string Name [get, set]
 Gets or sets the name of the node.
 
float Width [get, set]
 Gets or sets the width of the node.
 
float Height [get, set]
 Gets or sets the height of the node.
 
NodeType NodeType [get, set]
 Gets or sets the node type.
 
List< NodeConnectionInputs [get, set]
 Gets or sets the List of input connections of the node.
 
List< NodeConnectionOutputs [get, set]
 Gets or sets the List of output connections of the node.
 

Private Attributes

float width = 400.0f
 The width of the node.
 
float height = 300.0f
 The height of the node.
 
float xPosition = 0.0f
 The X position of the node.
 
float yPosition = 0.0f
 The Y position of the node.
 

Detailed Description

A base implementation of a dialogue node, from which all other nodes are derived.

Member Function Documentation

◆ AddInput() [1/2]

NodeConnection EasyTalk.Nodes.Core.Node.AddInput ( InputOutputType connectionType)

Adds a new input connection of the specified type to the node's inputs.

Parameters
connectionTypeThe type of input to add.
Returns
The newly created input connection.

◆ AddInput() [2/2]

void EasyTalk.Nodes.Core.Node.AddInput ( NodeConnection input)

Adds the provided input connection to the node's inputs.

Parameters
inputThe input connection to add.

◆ AddOutput() [1/2]

NodeConnection EasyTalk.Nodes.Core.Node.AddOutput ( InputOutputType connectionType)

Adds a new output connection of the specified type to the node's outputs.

Parameters
connectionTypeThe type of output to add.
Returns
The newly created output connection.

◆ AddOutput() [2/2]

void EasyTalk.Nodes.Core.Node.AddOutput ( NodeConnection output)

Adds the provided output connection to the node's outputs.

Parameters
outputThe output connection to add.

◆ Deserialize()

static Node EasyTalk.Nodes.Core.Node.Deserialize ( string json)
static

Deserializes a Node from the specified JSON string.

Parameters
jsonA JSON string representation for a Node.
Returns
A Node deserialized from the provided JSON string.

◆ FindDependencyOutputIDs()

List< int > EasyTalk.Nodes.Core.Node.FindDependencyOutputIDs ( )

Finds and returns a List of all output IDs which are connected to this node's value (non-dialogue-flow) inputs.

Returns
The IDs of output connections which the node is dependent upon.

◆ FindFlowInputs()

List< NodeConnection > EasyTalk.Nodes.Core.Node.FindFlowInputs ( )
protected

Finds and returns a List of all inputs which are dialogue flow inputs.

Returns
All inputs which are dialogue flow inputs.

◆ FindFlowOutputs()

List< NodeConnection > EasyTalk.Nodes.Core.Node.FindFlowOutputs ( )
protected

Finds and returns a List of all outputs which are dialogue flow outputs.

Returns
All outputs which are dialogue flow outputs.

◆ FindInputOfType()

NodeConnection EasyTalk.Nodes.Core.Node.FindInputOfType ( InputOutputType inputType)

Finds the first input which matches the specified input type.

Parameters
inputTypeThe input type to retrieve an input for.
Returns
The first input connection which matches the specified input type, or null if none exists.

◆ FindOutputOfType()

NodeConnection EasyTalk.Nodes.Core.Node.FindOutputOfType ( InputOutputType outputType)

Finds the first output which matches the specified output type.

Parameters
outputTypeThe output type to retrieve an output for.
Returns
The first output connection which matches the specified output type, or null if none exists.

◆ GetJSON()

string EasyTalk.Nodes.Core.Node.GetJSON ( )

Returns a JSON string representation of the node.

Returns
A JSON representation of the node.

◆ HasConnectedInputs()

bool EasyTalk.Nodes.Core.Node.HasConnectedInputs ( )

Returns true if this node has inputs which are connected to other node outputs.

Returns
Whether this node has inputs connected to other nodes.

◆ HasConnectedOutputs()

bool EasyTalk.Nodes.Core.Node.HasConnectedOutputs ( )

Returns true if this node has outputs which are connected to other node inputs.

Returns
Whether this node has outputs connected to the other nodes.

Member Data Documentation

◆ height

float EasyTalk.Nodes.Core.Node.height = 300.0f
private

The height of the node.

◆ inputs

List<NodeConnection> EasyTalk.Nodes.Core.Node.inputs = new List<NodeConnection>()
protected

A List of input connections of the node.

◆ name

string EasyTalk.Nodes.Core.Node.name
protected

The name of the node.

◆ nodeId

int EasyTalk.Nodes.Core.Node.nodeId = NodeUtils.NextID()
protected

The ID of the node.

◆ nodeType

NodeType EasyTalk.Nodes.Core.Node.nodeType
protected

The type of the node.

◆ outputs

List<NodeConnection> EasyTalk.Nodes.Core.Node.outputs = new List<NodeConnection>()
protected

A List of output connections of the node.

◆ width

float EasyTalk.Nodes.Core.Node.width = 400.0f
private

The width of the node.

◆ xPosition

float EasyTalk.Nodes.Core.Node.xPosition = 0.0f
private

The X position of the node.

◆ yPosition

float EasyTalk.Nodes.Core.Node.yPosition = 0.0f
private

The Y position of the node.

Property Documentation

◆ Height

float EasyTalk.Nodes.Core.Node.Height
getset

Gets or sets the height of the node.

◆ ID

int EasyTalk.Nodes.Core.Node.ID
getset

Gets or sets the node ID.

◆ Inputs

List<NodeConnection> EasyTalk.Nodes.Core.Node.Inputs
getset

Gets or sets the List of input connections of the node.

◆ Name

string EasyTalk.Nodes.Core.Node.Name
getset

Gets or sets the name of the node.

◆ NodeType

NodeType EasyTalk.Nodes.Core.Node.NodeType
getset

Gets or sets the node type.

◆ NodeTypeString

string EasyTalk.Nodes.Core.Node.NodeTypeString
getset

Gets or sets the node type string.

◆ Outputs

List<NodeConnection> EasyTalk.Nodes.Core.Node.Outputs
getset

Gets or sets the List of output connections of the node.

◆ Width

float EasyTalk.Nodes.Core.Node.Width
getset

Gets or sets the width of the node.

◆ XPosition

float EasyTalk.Nodes.Core.Node.XPosition
getset

Gets or sets the X position of the node.

◆ YPosition

float EasyTalk.Nodes.Core.Node.YPosition
getset

Gets or sets the Y position of the node.