Table of Contents

Class CVarSet

Namespace
ReFuel.CVarScript
Assembly
ReFuel.dll

A collection of configration variables.

public class CVarSet : CVar, IConvertible, IEnumerable<CVar>, IReadOnlyDictionary<string, CVar>, IReadOnlyCollection<KeyValuePair<string, CVar>>, IEnumerable<KeyValuePair<string, CVar>>, IEnumerable
Inheritance
CVarSet
Implements
Inherited Members
Extension Methods

Properties

Count

Gets the number of elements in the collection.

public int Count { get; }

Property Value

int

The number of elements in the collection.

Globals

public static CVarSet Globals { get; }

Property Value

CVarSet

this[CValue?]

public override CValue? this[CValue? indexer] { get; }

Parameters

indexer CValue

Property Value

CValue

this[string]

Gets the element that has the specified key in the read-only dictionary.

public CVar this[string key] { get; }

Parameters

key string

The key to locate.

Property Value

CVar

The element that has the specified key in the read-only dictionary.

Exceptions

ArgumentNullException

key is null.

KeyNotFoundException

The property is retrieved and key is not found.

Keys

Gets an enumerable collection that contains the keys in the read-only dictionary.

public IEnumerable<string> Keys { get; }

Property Value

IEnumerable<string>

An enumerable collection that contains the keys in the read-only dictionary.

TypeName

public override string TypeName { get; }

Property Value

string

ValueObject

public override object? ValueObject { get; }

Property Value

object

Values

Gets an enumerable collection that contains the values in the read-only dictionary.

public IEnumerable<CVar> Values { get; }

Property Value

IEnumerable<CVar>

An enumerable collection that contains the values in the read-only dictionary.

Methods

ContainsKey(string)

Determines whether the read-only dictionary contains an element that has the specified key.

public bool ContainsKey(string key)

Parameters

key string

The key to locate.

Returns

bool

true if the read-only dictionary contains an element that has the specified key; otherwise, false.

Exceptions

ArgumentNullException

key is null.

Execute(CContext, ICTerminal, IEnumerable<CValue?>)

public override CValue Execute(CContext context, ICTerminal terminal, IEnumerable<CValue?> arguments)

Parameters

context CContext
terminal ICTerminal
arguments IEnumerable<CValue>

Returns

CValue

Find(string)

public CVar? Find(string path)

Parameters

path string

Returns

CVar

Find<T>(string)

public T? Find<T>(string path) where T : CVar

Parameters

path string

Returns

T

Type Parameters

T

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<CVar> GetEnumerator()

Returns

IEnumerator<CVar>

An enumerator that can be used to iterate through the collection.

NewBindBool(string)

public CBind NewBindBool(string name)

Parameters

name string

Returns

CBind

NewBindSigned(string)

public CBind NewBindSigned(string name)

Parameters

name string

Returns

CBind

NewBindUnsigned(string)

public CBind NewBindUnsigned(string name)

Parameters

name string

Returns

CBind

NewCommand(string, CCommandHandler)

public CCommand NewCommand(string name, CCommandHandler handler)

Parameters

name string
handler CCommandHandler

Returns

CCommand

NewHive(string)

public CVarSet NewHive(string name)

Parameters

name string

Returns

CVarSet

NewLocalSet()

public static CVarSet NewLocalSet()

Returns

CVarSet

NewVariable<T>(string, T)

public CVar<T> NewVariable<T>(string name, T defaultValue)

Parameters

name string
defaultValue T

Returns

CVar<T>

Type Parameters

T

NewVariable<T>(string, T, CVarValidtor<T>)

public CVar<T> NewVariable<T>(string name, T defaultValue, CVarValidtor<T> validator)

Parameters

name string
defaultValue T
validator CVarValidtor<T>

Returns

CVar<T>

Type Parameters

T

NewVariable<T>(string, T, T?, T?)

public CVar<T> NewVariable<T>(string name, T defaultValue, T? minValue, T? maxValue) where T : IEquatable<T>

Parameters

name string
defaultValue T
minValue T
maxValue T

Returns

CVar<T>

Type Parameters

T

TryGetValue(string, out CVar)

Gets the value that is associated with the specified key.

public bool TryGetValue(string key, out CVar value)

Parameters

key string

The key to locate.

value CVar

When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

Returns

bool

true if the object that implements the IReadOnlyDictionary<TKey, TValue> interface contains an element that has the specified key; otherwise, false.

Exceptions

ArgumentNullException

key is null.