Reckfell.Collections.Dictionary<TKey, TValue>
Typed wrapper around Reckfell's Dictionary class, a dictionary of TKey and TValue annotated, Variant typed elements allocated in the engine in C++. Useful when interfacing with the engine. Otherwise prefer .NET collections such as System.Co
Typed wrapper around Reckfell's Dictionary class, a dictionary of TKey
and TValue annotated, Variant typed elements allocated in the engine in C++.
Useful when interfacing with the engine. Otherwise prefer .NET collections
such as System.Collections.Generic.Dictionary2`.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors3
Dictionary3 overloads
public Dictionary();Constructs a new empty Reckfell.Collections.Dictionary<TKey, TValue>.
public Dictionary(Reckfell.Collections.Dictionary dictionary);Constructs a new Reckfell.Collections.Dictionary<TKey, TValue> from the given dictionary's elements.
| Name | Type | Default |
|---|---|---|
dictionary | Reckfell.Collections.Dictionary | — |
dictionaryThe dictionary to construct from.
public Dictionary(System.Collections.Generic.IDictionary<TKey, TValue> dictionary);Constructs a new Reckfell.Collections.Dictionary<TKey, TValue> from the given dictionary's elements.
| Name | Type | Default |
|---|---|---|
dictionary | System.Collections.Generic.IDictionary<TKey, TValue> | — |
dictionaryThe dictionary to construct from.
Properties5
CountProperty
public int Count { get; }Returns the number of elements in this Reckfell.Collections.Dictionary<TKey, TValue>.
This is also known as the size or length of the dictionary.
IsReadOnlyProperty
public bool IsReadOnly { get; }Returns true if the dictionary is read-only.
See Reckfell.Collections.Dictionary<TKey, TValue>.MakeReadOnly.
ItemProperty
public TValue? this[TKey? key] { get; set; }Returns the value at the given key.
KeysProperty
public System.Collections.Generic.ICollection<TKey> Keys { get; }Gets the collection of keys in this Reckfell.Collections.Dictionary<TKey, TValue>.
ValuesProperty
public System.Collections.Generic.ICollection<TValue> Values { get; }Gets the collection of elements in this Reckfell.Collections.Dictionary<TKey, TValue>.
Methods14
Addvoid
public void Add(TKey? key, TValue? value);Adds an object Range.Value at key key
to this Reckfell.Collections.Dictionary<TKey, TValue>.
| Name | Type | Default |
|---|---|---|
key | TKey | — |
value | TValue | — |
keyThe key at which to add the object.
valueThe object to add.
Clearvoid
public void Clear();Clears the dictionary, removing all entries from it.
ContainsKeybool
public bool ContainsKey(TKey? key);Checks if this Reckfell.Collections.Dictionary<TKey, TValue> contains the given key.
| Name | Type | Default |
|---|---|---|
key | TKey | — |
keyThe key to look for.
boolWhether or not this dictionary contains the given key.
DuplicateReckfell.Collections.Dictionary<TKey, TValue>
public Reckfell.Collections.Dictionary<TKey, TValue> Duplicate(bool deep = false);Returns a copy of the Reckfell.Collections.Dictionary<TKey, TValue>.
If deep is true, a deep copy is performed:
all nested arrays and dictionaries are duplicated and will not be shared with
the original dictionary. If false, a shallow copy is made and
references to the original nested arrays and dictionaries are kept, so that
modifying a sub-array or dictionary in the copy will also impact those
referenced in the source dictionary. Note that any ReckfellObject derived
elements will be shallow copied regardless of the deep
setting.
| Name | Type | Default |
|---|---|---|
deep | bool | false |
deepIf true, performs a deep copy.
Reckfell.Collections.Dictionary<TKey, TValue>A new Reckfell Dictionary.
GetEnumeratorSystem.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, TValue>>
public System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, TValue>> GetEnumerator();Gets an enumerator for this Reckfell.Collections.Dictionary<TKey, TValue>.
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, TValue>>An enumerator.
MakeReadOnlyvoid
public void MakeReadOnly();Makes the Reckfell.Collections.Dictionary<TKey, TValue> read-only, i.e. disabled
modying of the dictionary's elements. Does not apply to nested content,
e.g. content of nested dictionaries.
Mergevoid
public void Merge(Reckfell.Collections.Dictionary<TKey, TValue> dictionary, bool overwrite = false);| Name | Type | Default |
|---|---|---|
dictionary | Reckfell.Collections.Dictionary<TKey, TValue> | — |
overwrite | bool | false |
RecursiveEqualbool
public bool RecursiveEqual(Reckfell.Collections.Dictionary<TKey, TValue> other);| Name | Type | Default |
|---|---|---|
other | Reckfell.Collections.Dictionary<TKey, TValue> | — |
boolRemovebool
public bool Remove(TKey? key);Removes an element from this Reckfell.Collections.Dictionary<TKey, TValue> by key.
| Name | Type | Default |
|---|---|---|
key | TKey | — |
keyThe key of the element to remove.
boolToStringstring
public override string ToString();Converts this Reckfell.Collections.Dictionary<TKey, TValue> to a string.
stringA string representation of this dictionary.
TryGetValuebool
public bool TryGetValue(TKey? key, out TValue? value);Gets the value for the given key in the dictionary.
Returns true if an entry for the given key exists in
the dictionary; otherwise, returns false.
| Name | Type | Default |
|---|---|---|
key | TKey | — |
value | TValue | — |
keyThe key of the element to get.
valueThe value at the given key.
boolIf an entry was found for the given key.
op_Explicit2 overloads
public static explicit operator Reckfell.Collections.Dictionary(Reckfell.Collections.Dictionary<TKey, TValue>? from);| Name | Type | Default |
|---|---|---|
from | Reckfell.Collections.Dictionary<TKey, TValue> | — |
Reckfell.Collections.Dictionarypublic static explicit operator Reckfell.Collections.Dictionary<TKey, TValue>(Variant from);| Name | Type | Default |
|---|---|---|
from | Variant | — |
Reckfell.Collections.Dictionary<TKey, TValue>op_ImplicitVariant
public static implicit operator Variant(Reckfell.Collections.Dictionary<TKey, TValue> from);| Name | Type | Default |
|---|---|---|
from | Reckfell.Collections.Dictionary<TKey, TValue> | — |
Variant