The NodeVariable class is used to store information about a dialogue variable, such as its type, name, initial value, and current value.
More...
|
static string | RemoveVariables (string text) |
| Strips all variable references from the provided string and returns a new string.
|
|
static string | IndexVariablesNames (string text, Dictionary< string, string > nameReplacementMap) |
| Takes each variable in the provided string and replaces it with a numeric variable reference. The nameReplacementMap is populated with the new variable reference names as the keys, and the old variable reference names as the values. This method is useful for translations of text which contain variable references since automatic translation could potentially rename variable references; nameing the variables numerically prevents this and allows the original variable names to be swapped back into the string later.
|
|
static string | ReplaceVariablesNames (string text, Dictionary< string, string > nameReplacementMap) |
| Given a string, this method replaces the names of each variable reference in the string with the value attributed to the key of the same name in the provided nameReplacementMap.
|
|
The NodeVariable class is used to store information about a dialogue variable, such as its type, name, initial value, and current value.
◆ IndexVariablesNames()
static string EasyTalk.Nodes.Variable.NodeVariable.IndexVariablesNames |
( |
string | text, |
|
|
Dictionary< string, string > | nameReplacementMap ) |
|
static |
Takes each variable in the provided string and replaces it with a numeric variable reference. The nameReplacementMap is populated with the new variable reference names as the keys, and the old variable reference names as the values. This method is useful for translations of text which contain variable references since automatic translation could potentially rename variable references; nameing the variables numerically prevents this and allows the original variable names to be swapped back into the string later.
- Parameters
-
text | The string to index variable references for. |
nameReplacementMap | A Dictionary which maps the new variable reference names to the old names. |
- Returns
- A modified version of the original string with indexed variable references.
◆ RemoveVariables()
static string EasyTalk.Nodes.Variable.NodeVariable.RemoveVariables |
( |
string | text | ) |
|
|
static |
Strips all variable references from the provided string and returns a new string.
- Parameters
-
text | The string to remove variable references from. |
- Returns
- A modified version of the provided string with all references to variables removed.
◆ ReplaceVariablesNames()
static string EasyTalk.Nodes.Variable.NodeVariable.ReplaceVariablesNames |
( |
string | text, |
|
|
Dictionary< string, string > | nameReplacementMap ) |
|
static |
Given a string, this method replaces the names of each variable reference in the string with the value attributed to the key of the same name in the provided nameReplacementMap.
- Parameters
-
text | The string to replace variable name references in. |
nameReplacementMap | A mapping of current variable names to replacement names. |
- Returns
- A modified version of the original string where the original variable name references have been replaced based upon the values in the nameReplacementMap.
◆ currentValue
object EasyTalk.Nodes.Variable.NodeVariable.currentValue |
The current value of the variable.
◆ initialValue
object EasyTalk.Nodes.Variable.NodeVariable.initialValue |
The initial value of the variable.
◆ resetOnEntry
bool EasyTalk.Nodes.Variable.NodeVariable.resetOnEntry |
Whether the variable should be reset to its initial value each time the dialogue is entered.
◆ variableName
string EasyTalk.Nodes.Variable.NodeVariable.variableName |
◆ variableType
Type EasyTalk.Nodes.Variable.NodeVariable.variableType |