Wrench.FullVariableSet Class Reference

Detailed Description

This set represents a set of variables in text, denoted by Implemented at e.g. UI.Variables/Speech.Variables. The event OnFind can be used to resolve a variable not found in either custom variables or the language (for localization) set. Nested variables (variables in a variables text) are evaluated at the point of replacement, not load.

Public Member Functions

 FullVariableSet ()
 Creates a new complete variable set. More...
 
void ChangeLanguageSet (LanguageSet language)
 Changes the language set. Called when the language is changed. More...
 
string GetValue (string variableString)
 Gets the content of a named variable. More...
 
void SetGroupResolver (GroupResolve resolver)
 Sets the group resolver to use when resolving a group name from a variable that isn't found in the languages groups. More...
 
void SetValue (string code, string value)
 Sets a custom variable with the given name and value. This will take top priority. More...
 

Public Attributes

VariableSet Custom
 The custom set of variables added and edited at runtime. More...
 
LanguageSet Language
 The set of variables loaded from the language file. More...
 

Properties

string this[string code] [get, set]
 Gets or sets custom variables. More...
 

Events

OnVariableFind OnFind
 A callback called if a variable isn't found in either Custom/Language. More...
 
OnVariableChange OnChange
 A callback called when a custom variable in this set is changed. More...
 

Constructor & Destructor Documentation

Wrench.FullVariableSet.FullVariableSet ( )
inline

Creates a new complete variable set.

Member Function Documentation

void Wrench.FullVariableSet.ChangeLanguageSet ( LanguageSet  language)
inline

Changes the language set. Called when the language is changed.

Parameters
languageThe new language set to use.
string Wrench.FullVariableSet.GetValue ( string  variableString)
inline

Gets the content of a named variable.

Parameters
variableStringThe variable name.
Returns
The variable value, if found; null otherwise.
void Wrench.FullVariableSet.SetGroupResolver ( GroupResolve  resolver)
inline

Sets the group resolver to use when resolving a group name from a variable that isn't found in the languages groups.

Parameters
resolverThe resolver to use.
void Wrench.FullVariableSet.SetValue ( string  code,
string  value 
)
inline

Sets a custom variable with the given name and value. This will take top priority.

Parameters
codeThe name of the variable to set.
valueThe value to set it to.

Member Data Documentation

VariableSet Wrench.FullVariableSet.Custom

The custom set of variables added and edited at runtime.

LanguageSet Wrench.FullVariableSet.Language

The set of variables loaded from the language file.

Property Documentation

string Wrench.FullVariableSet.this[string code]
getset

Gets or sets custom variables.

Parameters
codeThe name of the variable to get/set.

Event Documentation

OnVariableChange Wrench.FullVariableSet.OnChange

A callback called when a custom variable in this set is changed.

OnVariableFind Wrench.FullVariableSet.OnFind

A callback called if a variable isn't found in either Custom/Language.