Typed wrapper around Godot’s Dictionary class, a dictionary of
and annotated, Variant typed elements allocated in the engine in C++.
Useful when interfacing with the engine. Otherwise prefer .NET collections
such as .
Constructors
Dictionary__ItemData__number.__new()
Constructs a new empty .
Dictionary__ItemData__number.__new()
Dictionary__ItemData__number.__new(IDictionary__ItemData__number)
Dictionary__ItemData__number.__new(dictionary: IDictionary__ItemData__number)
| Type |
Name |
Description |
| IDictionary__ItemData__number |
dictionary |
|
Dictionary__ItemData__number.__new(Dictionary)
Constructs a new from the given dictionary’s elements.
Dictionary__ItemData__number.__new(dictionary: Dictionary)
| Type |
Name |
Description |
| Dictionary |
dictionary |
The dictionary to construct from. |
ReadOnly
| Type |
Name |
Static |
Default |
Description |
| number |
Count |
|
|
Returns the number of elements in this . This is also known as the size or length of the dictionary. |
| boolean |
IsReadOnly |
|
|
Returns if the dictionary is read-only. See . |
| ICollection__ItemData |
Keys |
|
|
Gets the collection of keys in this . |
| ICollection__number |
Values |
|
|
Gets the collection of elements in this . |
Properties
| Type |
Getter |
Setter |
Static |
Default |
Description |
| number |
get_Item() |
set_Item(val) |
|
|
|
Functions
Requires an instance!
Duplicate(boolean)
Returns a copy of the . If is , a deep copy is performed: all nested arrays and dictionaries are duplicated and will not be shared with the original dictionary. If , 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 derived elements will be shallow copied regardless of the setting.
Duplicate(deep: boolean = False) -> Dictionary__ItemData__number
| Type |
Name |
Description |
| boolean |
deep |
If , performs a deep copy. |
Merge(Dictionary__ItemData__number,boolean)
Merge(dictionary: Dictionary__ItemData__number,overwrite: boolean = False) -> nil
| Type |
Name |
Description |
| Dictionary__ItemData__number |
dictionary |
|
| boolean |
overwrite |
|
RecursiveEqual(Dictionary__ItemData__number)
RecursiveEqual(other: Dictionary__ItemData__number) -> boolean
| Type |
Name |
Description |
| Dictionary__ItemData__number |
other |
|
Add(ItemData,number)
Add(key: ItemData,value: number) -> nil
| Type |
Name |
Description |
| ItemData |
key |
|
| number |
value |
|
ContainsKey(ItemData)
ContainsKey(key: ItemData) -> boolean
| Type |
Name |
Description |
| ItemData |
key |
|
Remove(ItemData)
Remove(key: ItemData) -> boolean
| Type |
Name |
Description |
| ItemData |
key |
|
TryGetValue(ItemData,Int32&)
TryGetValue(key: ItemData,value: Int32&) -> boolean
| Type |
Name |
Description |
| ItemData |
key |
|
| Int32& |
value |
|
MakeReadOnly
Makes the read-only, i.e. disabled modying of the dictionary’s elements. Does not apply to nested content, e.g. content of nested dictionaries.
Clear
Clears the dictionary, removing all entries from it.
GetEnumerator
Gets an enumerator for this .
GetEnumerator() -> IEnumerator__KeyValuePair__ItemData__number
ToString
Converts this to a string.