Can be used to provide global values that do not need to be passed in as arguments when formatting a string.
The smart string should take the format {groupName.variableName}. e.g {global.player-score}.
Note: The group name and variable names must not contain any spaces.
Inheritance
GlobalVariablesSource
public class GlobalVariablesSource : object, ISource, IDictionary<string, GlobalVariablesGroup>, ISerializationCallbackReceiver
Constructors
Declaration
public GlobalVariablesSource(SmartFormatter formatter)
Parameters
Properties
Declaration
public int Count { get; }
Property Value
Declaration
public bool IsReadOnly { get; }
Property Value
Has BeginUpdating() been called?
This can be used when updating the value of multiple IGlobalVariable in order to do
a single update after the updates instead of 1 per change.
Declaration
public static bool IsUpdating { get; }
Property Value
Declaration
public GlobalVariablesGroup this[string name] { get; set; }
Parameters
Type |
Name |
Description |
String |
name |
|
Property Value
Declaration
public ICollection<string> Keys { get; }
Property Value
Type |
Description |
ICollection<String> |
|
Declaration
public ICollection<GlobalVariablesGroup> Values { get; }
Property Value
Methods
Declaration
public void Add(KeyValuePair<string, GlobalVariablesGroup> item)
Parameters
Declaration
public void Add(string name, GlobalVariablesGroup group)
Parameters
Declaration
public static void BeginUpdating()
Declaration
Declaration
public bool Contains(KeyValuePair<string, GlobalVariablesGroup> item)
Parameters
Returns
Declaration
public bool ContainsKey(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
Declaration
public void CopyTo(KeyValuePair<string, GlobalVariablesGroup>[] array, int arrayIndex)
Parameters
Declaration
public static void EndUpdating()
Declaration
public IEnumerator GetEnumerator()
Returns
Type |
Description |
IEnumerator |
|
Declaration
public void OnAfterDeserialize()
Declaration
public void OnBeforeSerialize()
Declaration
public bool Remove(KeyValuePair<string, GlobalVariablesGroup> item)
Parameters
Returns
Declaration
public bool Remove(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
Declaration
public bool TryEvaluateSelector(ISelectorInfo selectorInfo)
Parameters
Returns
Implements
Declaration
public bool TryGetValue(string name, out GlobalVariablesGroup value)
Parameters
Returns
Declaration
public static IDisposable UpdateScope()
Returns
Type |
Description |
IDisposable |
|
Events
Called after the final EndUpdating() has been called.
This can be used when you wish to respond to value change events but wish to do a
single update at the end instead of 1 per change.
For example, if you wanted to change the value of multiple global variables
that a smart string was using then changing each value would result in a new string
being generated, by using begin and end the string generation can be deferred until the
final change so that only 1 update is performed.
Declaration
public static event Action EndUpdate
Event Type
Extension Methods