EasyTalk API
Loading...
Searching...
No Matches
EasyTalk.Nodes.Logic.ConditionalValueNode Class Reference

A node which chooses a value and sends it to its value output based on its current boolean value/input. More...

Inherits EasyTalk.Nodes.Core.Node, EasyTalk.Nodes.Core.DialogueFlowNode, and EasyTalk.Nodes.Core.FunctionalNode.

Public Member Functions

 ConditionalValueNode ()
 Creates a new ConditionalValueNode.
 
void DetermineAndStoreValue (NodeHandler nodeHandler, Dictionary< int, object > nodeValues, GameObject convoOwner=null)
 Determines the value of this node and stores it in the provided Dictionary of node and connection IDs to values.
Parameters
nodeHandlerThe node handler being used.
nodeValuesA mapping between node or connection IDs and the values attributed to them.
convoOwnerThe GameObject which on which the dialogue logic is currently running.

 
List< int > GetDependencyOutputIDs ()
 Returns a List of IDs for output connections that this node is dependent on in order to evaluate itself and determine the value to store.
Returns
The List of output connections that this node is dependent on.

 
NodeConnection GetFlowInput ()
 Returns the dialogue flow input for the node.
Returns
The dialogue flow input for the node.

 
NodeConnection GetFlowOutput ()
 Returns the dialogue flow output for the node.
Returns
The dialogue flow output for the node.

 
bool HasDependencies ()
 Returns whether the node is dependent on values coming into input connections.
Returns
Whether the node has dependencies.

 
- Public Member Functions inherited from EasyTalk.Nodes.Core.Node
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.
 

Properties

string TrueValue [get, set]
 Gets or sets the value which will be output when the node evaluates to true.
 
string FalseValue [get, set]
 Gets or sets the value which will be output when the node evaluates to false.
 
bool BoolValue [get, set]
 Gets or sets the boolean value the node is set to.
 
string ValueOutputType [get, set]
 Gets or sets the type of value this node outputs (from a string equivalent to a ValueOutputType toString() value).
 
- Properties inherited from EasyTalk.Nodes.Core.Node
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 Member Functions

object DetermineValue (string valueString)
 Determines and returns the appropriate type of value for the string value provided based on the type of value this node is set to output.
 

Private Attributes

ValueOutputType valueOutputType
 The type of value this node outputs.
 
string trueValue
 The value to output when the node evaluates to true.
 
string falseValue
 The value to output when the node evaluates to false.
 
bool boolValue
 The boolean value of the node.
 

Additional Inherited Members

- Static Public Member Functions inherited from EasyTalk.Nodes.Core.Node
static Node Deserialize (string json)
 Deserializes a Node from the specified JSON string.
 
- Protected Member Functions inherited from EasyTalk.Nodes.Core.Node
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 inherited from EasyTalk.Nodes.Core.Node
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.
 

Detailed Description

A node which chooses a value and sends it to its value output based on its current boolean value/input.

Constructor & Destructor Documentation

◆ ConditionalValueNode()

EasyTalk.Nodes.Logic.ConditionalValueNode.ConditionalValueNode ( )

Creates a new ConditionalValueNode.

Member Function Documentation

◆ DetermineAndStoreValue()

void EasyTalk.Nodes.Logic.ConditionalValueNode.DetermineAndStoreValue ( NodeHandler nodeHandler,
Dictionary< int, object > nodeValues,
GameObject convoOwner = null )

Determines the value of this node and stores it in the provided Dictionary of node and connection IDs to values.

Parameters
nodeHandlerThe node handler being used.
nodeValuesA mapping between node or connection IDs and the values attributed to them.
convoOwnerThe GameObject which on which the dialogue logic is currently running.

Implements EasyTalk.Nodes.Core.FunctionalNode.

◆ DetermineValue()

object EasyTalk.Nodes.Logic.ConditionalValueNode.DetermineValue ( string valueString)
private

Determines and returns the appropriate type of value for the string value provided based on the type of value this node is set to output.

Parameters
valueStringThe string to get a value for.
Returns
The value this node should output.

◆ GetDependencyOutputIDs()

List< int > EasyTalk.Nodes.Logic.ConditionalValueNode.GetDependencyOutputIDs ( )

Returns a List of IDs for output connections that this node is dependent on in order to evaluate itself and determine the value to store.

Returns
The List of output connections that this node is dependent on.

Implements EasyTalk.Nodes.Core.FunctionalNode.

◆ GetFlowInput()

NodeConnection EasyTalk.Nodes.Logic.ConditionalValueNode.GetFlowInput ( )

Returns the dialogue flow input for the node.

Returns
The dialogue flow input for the node.

Implements EasyTalk.Nodes.Core.DialogueFlowNode.

◆ GetFlowOutput()

NodeConnection EasyTalk.Nodes.Logic.ConditionalValueNode.GetFlowOutput ( )

Returns the dialogue flow output for the node.

Returns
The dialogue flow output for the node.

Implements EasyTalk.Nodes.Core.DialogueFlowNode.

◆ HasDependencies()

bool EasyTalk.Nodes.Logic.ConditionalValueNode.HasDependencies ( )

Returns whether the node is dependent on values coming into input connections.

Returns
Whether the node has dependencies.

Implements EasyTalk.Nodes.Core.FunctionalNode.

Member Data Documentation

◆ boolValue

bool EasyTalk.Nodes.Logic.ConditionalValueNode.boolValue
private

The boolean value of the node.

◆ falseValue

string EasyTalk.Nodes.Logic.ConditionalValueNode.falseValue
private

The value to output when the node evaluates to false.

◆ trueValue

string EasyTalk.Nodes.Logic.ConditionalValueNode.trueValue
private

The value to output when the node evaluates to true.

◆ valueOutputType

ValueOutputType EasyTalk.Nodes.Logic.ConditionalValueNode.valueOutputType
private

The type of value this node outputs.

Property Documentation

◆ BoolValue

bool EasyTalk.Nodes.Logic.ConditionalValueNode.BoolValue
getset

Gets or sets the boolean value the node is set to.

◆ FalseValue

string EasyTalk.Nodes.Logic.ConditionalValueNode.FalseValue
getset

Gets or sets the value which will be output when the node evaluates to false.

◆ TrueValue

string EasyTalk.Nodes.Logic.ConditionalValueNode.TrueValue
getset

Gets or sets the value which will be output when the node evaluates to true.

◆ ValueOutputType

string EasyTalk.Nodes.Logic.ConditionalValueNode.ValueOutputType
getset

Gets or sets the type of value this node outputs (from a string equivalent to a ValueOutputType toString() value).