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
this[CValue?]
public override CValue? this[CValue? indexer] { get; }
Parameters
indexerCValue
Property Value
this[string]
Gets the element that has the specified key in the read-only dictionary.
public CVar this[string key] { get; }
Parameters
keystringThe key to locate.
Property Value
- CVar
The element that has the specified key in the read-only dictionary.
Exceptions
- ArgumentNullException
keyis null.- KeyNotFoundException
The property is retrieved and
keyis 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
ValueObject
public override object? ValueObject { get; }
Property Value
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
keystringThe key to locate.
Returns
- bool
true if the read-only dictionary contains an element that has the specified key; otherwise, false.
Exceptions
- ArgumentNullException
keyis null.
Execute(CContext, ICTerminal, IEnumerable<CValue?>)
public override CValue Execute(CContext context, ICTerminal terminal, IEnumerable<CValue?> arguments)
Parameters
contextCContextterminalICTerminalargumentsIEnumerable<CValue>
Returns
Find(string)
public CVar? Find(string path)
Parameters
pathstring
Returns
Find<T>(string)
public T? Find<T>(string path) where T : CVar
Parameters
pathstring
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
namestring
Returns
NewBindSigned(string)
public CBind NewBindSigned(string name)
Parameters
namestring
Returns
NewBindUnsigned(string)
public CBind NewBindUnsigned(string name)
Parameters
namestring
Returns
NewCommand(string, CCommandHandler)
public CCommand NewCommand(string name, CCommandHandler handler)
Parameters
namestringhandlerCCommandHandler
Returns
NewHive(string)
public CVarSet NewHive(string name)
Parameters
namestring
Returns
NewLocalSet()
public static CVarSet NewLocalSet()
Returns
NewVariable<T>(string, T)
public CVar<T> NewVariable<T>(string name, T defaultValue)
Parameters
namestringdefaultValueT
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
namestringdefaultValueTvalidatorCVarValidtor<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
namestringdefaultValueTminValueTmaxValueT
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
keystringThe key to locate.
valueCVarWhen this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the
valueparameter. 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
keyis null.