EasyTalk API
Loading...
Searching...
No Matches
EasyTalk.Nodes.Utility.PlayerInputNode Class Reference

A node for getting text input from the player. More...

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

Public Member Functions

 PlayerInputNode ()
 Creates a new PlayerInput node.
 
bool 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.
Returns
Returns true if the value was determined and stored successfully. IF the value could not be determined (perhaps due to needing to await feedback or other processing), this method returns false.

 
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.

 
void Reset ()
 Used to reset an async node after it has completed execution.
 
void Execute (NodeHandler nodeHandler, Dictionary< int, object > nodeValues, GameObject convoOwner=null)
 Hands execution over to the NodeHandler, which should send a signal for the node to be handled externally.
Parameters
nodeHandlerThe NodeHandler processing the node.
nodeValuesA mapping of input/output and node IDs to values attributed to those IDs.
convoOwnerThe current conversation owner.

 
void ExecutionCompleted ()
 Must be called whenever a node is finished being processed. The node should typically let the NodeHandler know that it has finished execution in this method.
 
bool IsExecutionComplete ()
 Returns whether or not the node has finished being processed/used.
Returns

 
bool IsSkippable ()
 Returns whether or not the node can be skipped before processing has been completed.
Returns

 
void Interrupt ()
 Interrupts the execution of the node, if it is skippable.
 
- 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 HintText [get, set]
 Gets or sets the hint text for the node.
 
string InputText [get, set]
 Gets or sets the text which was input by the player.
 
AsyncCompletionMode AsyncCompletionMode [get]
 Returns the AsyncCompletion mode of the node.
 
bool IsExecutingFromDialogueFlow [get, set]
 Returns whether or not the node is being processed along the normal dialogue flow path, rather than back/forward value propagation.
 
- 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.
 
- Properties inherited from EasyTalk.Nodes.Core.AsyncNode

Private Attributes

string hintText = "Enter Response..."
 The hint text to show to the player.
 
string inputText = ""
 The text obtained from the player.
 
bool isExecutionComplete = false
 Whether or not execution is completed on the node.
 
NodeHandler nodeHandler = null
 The NodeHandler used to process the node.
 
bool isExecutingFromDialogueFlow = true
 Indicates whether the node is being executed along the normal dialogue flow path, rather than via back/forward value propagation.
 

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 for getting text input from the player.

Constructor & Destructor Documentation

◆ PlayerInputNode()

EasyTalk.Nodes.Utility.PlayerInputNode.PlayerInputNode ( )

Creates a new PlayerInput node.

Member Function Documentation

◆ DetermineAndStoreValue()

bool EasyTalk.Nodes.Utility.PlayerInputNode.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.
Returns
Returns true if the value was determined and stored successfully. IF the value could not be determined (perhaps due to needing to await feedback or other processing), this method returns false.

Implements EasyTalk.Nodes.Core.FunctionalNode.

◆ Execute()

void EasyTalk.Nodes.Utility.PlayerInputNode.Execute ( NodeHandler nodeHandler,
Dictionary< int, object > nodeValues,
GameObject convoOwner = null )

Hands execution over to the NodeHandler, which should send a signal for the node to be handled externally.

Parameters
nodeHandlerThe NodeHandler processing the node.
nodeValuesA mapping of input/output and node IDs to values attributed to those IDs.
convoOwnerThe current conversation owner.

Implements EasyTalk.Nodes.Core.AsyncNode.

◆ ExecutionCompleted()

void EasyTalk.Nodes.Utility.PlayerInputNode.ExecutionCompleted ( )

Must be called whenever a node is finished being processed. The node should typically let the NodeHandler know that it has finished execution in this method.

Implements EasyTalk.Nodes.Core.AsyncNode.

◆ GetDependencyOutputIDs()

List< int > EasyTalk.Nodes.Utility.PlayerInputNode.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.Utility.PlayerInputNode.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.Utility.PlayerInputNode.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.Utility.PlayerInputNode.HasDependencies ( )

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

Returns
Whether the node has dependencies.

Implements EasyTalk.Nodes.Core.FunctionalNode.

◆ Interrupt()

void EasyTalk.Nodes.Utility.PlayerInputNode.Interrupt ( )

Interrupts the execution of the node, if it is skippable.

Implements EasyTalk.Nodes.Core.AsyncNode.

◆ IsExecutionComplete()

bool EasyTalk.Nodes.Utility.PlayerInputNode.IsExecutionComplete ( )

Returns whether or not the node has finished being processed/used.

Returns

Implements EasyTalk.Nodes.Core.AsyncNode.

◆ IsSkippable()

bool EasyTalk.Nodes.Utility.PlayerInputNode.IsSkippable ( )

Returns whether or not the node can be skipped before processing has been completed.

Returns

Implements EasyTalk.Nodes.Core.AsyncNode.

◆ Reset()

void EasyTalk.Nodes.Utility.PlayerInputNode.Reset ( )

Used to reset an async node after it has completed execution.

Implements EasyTalk.Nodes.Core.AsyncNode.

Member Data Documentation

◆ hintText

string EasyTalk.Nodes.Utility.PlayerInputNode.hintText = "Enter Response..."
private

The hint text to show to the player.

◆ inputText

string EasyTalk.Nodes.Utility.PlayerInputNode.inputText = ""
private

The text obtained from the player.

◆ isExecutingFromDialogueFlow

bool EasyTalk.Nodes.Utility.PlayerInputNode.isExecutingFromDialogueFlow = true
private

Indicates whether the node is being executed along the normal dialogue flow path, rather than via back/forward value propagation.

◆ isExecutionComplete

bool EasyTalk.Nodes.Utility.PlayerInputNode.isExecutionComplete = false
private

Whether or not execution is completed on the node.

◆ nodeHandler

NodeHandler EasyTalk.Nodes.Utility.PlayerInputNode.nodeHandler = null
private

The NodeHandler used to process the node.

Property Documentation

◆ AsyncCompletionMode

AsyncCompletionMode EasyTalk.Nodes.Utility.PlayerInputNode.AsyncCompletionMode
get

Returns the AsyncCompletion mode of the node.

Implements EasyTalk.Nodes.Core.AsyncNode.

◆ HintText

string EasyTalk.Nodes.Utility.PlayerInputNode.HintText
getset

Gets or sets the hint text for the node.

◆ InputText

string EasyTalk.Nodes.Utility.PlayerInputNode.InputText
getset

Gets or sets the text which was input by the player.

◆ IsExecutingFromDialogueFlow

bool EasyTalk.Nodes.Utility.PlayerInputNode.IsExecutingFromDialogueFlow
getset

Returns whether or not the node is being processed along the normal dialogue flow path, rather than back/forward value propagation.

Implements EasyTalk.Nodes.Core.AsyncNode.