Class Table
- Namespace
- Luny /
- Assembly
- Luny.dll
Dictionary-based variable storage.
public sealed class Table : ITable, IEnumerable<KeyValuePair<String, Variable>>, IEnumerable
Expand Details ...
- Inheritance
-
ObjectTable
- Implements
Constructors
Table()
public Table()
Properties
Count
Gets the number of variables.
public Int32 Count { get; }
Property Value
this[String]
Gets or sets a variable by name.
public Variable this[String key] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
key |
Property Value
Methods
DefineConstant(String, Variable)
Defines a constant variable that cannot be modified after creation.
public Table.VarHandle DefineConstant(String key, Variable variable)
Parameters
| Type | Name | Description |
|---|---|---|
key |
The constant name. |
|
variable |
The constant value. |
Returns
DefineVariable(String, Variable)
Defines a variable with initial value.
public Table.VarHandle DefineVariable(String key, Variable variable)
Parameters
| Type | Name | Description |
|---|---|---|
key |
||
variable |
Returns
Exceptions
GetEnumerator()
public IEnumerator<KeyValuePair<String, Variable>> GetEnumerator()
Returns
GetHandle(String)
Gets a handle to a variable.
public Table.VarHandle GetHandle(String key)
Parameters
| Type | Name | Description |
|---|---|---|
key |
Returns
GetHandle<T>(String)
Gets or creates a typed handle to a variable.
public Table.VarHandle<T> GetHandle<T>(String key)
Parameters
| Type | Name | Description |
|---|---|---|
key |
Returns
Type Parameters
T
Get<T>(String)
Gets a variable with type casting.
public T Get<T>(String key)
Parameters
| Type | Name | Description |
|---|---|---|
key |
Returns
- T
Type Parameters
T
Has(String)
Checks if a variable exists.
public Boolean Has(String key)
Parameters
| Type | Name | Description |
|---|---|---|
key |
Returns
- Boolean
Remove(String)
Removes a variable.
public Boolean Remove(String key)
Parameters
| Type | Name | Description |
|---|---|---|
key |
Returns
- Boolean
RemoveAll()
Removes all variables.
public void RemoveAll()
ResetValue(String)
Resets a variable's value to default.
public void ResetValue(String key)
Parameters
| Type | Name | Description |
|---|---|---|
key |
ResetValues()
Resets values of all variables to their default value.
public void ResetValues()
ToString()
[ExcludeFromCodeCoverage]
public override String ToString()
Returns
- String
Events
OnVariableChanged
Fired when a variable is changed.
public event EventHandler<VariableChangedArgs> OnVariableChanged