Table of Contents

Class Table

Namespace
Luny
Assembly
Luny.dll

Dictionary-based variable storage.

public sealed class Table : ITable
Inheritance
object
Table
Implements

Constructors

Table()

public Table()

Properties

Count

Gets the number of variables.

public int Count { get; }

Property Value

int

this[string]

Gets or sets a variable by name.

public Variable this[string key] { get; set; }

Parameters

key string

Property Value

Variable

Methods

DefineConstant(string, Variable)

Defines a constant variable that cannot be modified after creation.

public Table.ScalarVarHandle DefineConstant(string key, Variable value)

Parameters

key string

The constant name.

value Variable

The constant value.

Returns

Table.ScalarVarHandle

The handle to the constant.

DefineVariable(string, Variable)

Defines a variable with initial value.

public Table.ScalarVarHandle DefineVariable(string key, Variable value)

Parameters

key string
value Variable

Returns

Table.ScalarVarHandle

Exceptions

InvalidOperationException

GetEnumerator()

public IEnumerator<KeyValuePair<string, Variable>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<string, Variable>>

GetHandle(string)

Gets a handle to a variable.

public Table.ScalarVarHandle GetHandle(string key)

Parameters

key string

Returns

Table.ScalarVarHandle

GetHandle<T>(string)

Gets or creates a typed handle to a variable.

public Table.VarHandle<T> GetHandle<T>(string key)

Parameters

key string

Returns

Table.VarHandle<T>

Type Parameters

T

Get<T>(string)

Gets a variable with type casting.

public T Get<T>(string key)

Parameters

key string

Returns

T

Type Parameters

T

Has(string)

Checks if a variable exists.

public bool Has(string key)

Parameters

key string

Returns

bool

Remove(string)

Removes a variable.

public bool Remove(string key)

Parameters

key string

Returns

bool

RemoveAll()

Removes all variables.

public void RemoveAll()

ResetValue(string)

Resets a variable's value to default.

public void ResetValue(string key)

Parameters

key string

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. Only invoked in debug builds.

public event EventHandler<VariableChangedArgs> OnVariableChanged

Event Type

EventHandler<VariableChangedArgs>