Enfusion Script API
|
Associative array template. More...
Public Member Functions | |
proto native int | Count () |
proto native bool | IsEmpty () |
proto native void | Clear () |
Clears the map. | |
proto TValue | Get (TKey key) |
Search for an element with the given key. | |
proto bool | Find (TKey key, out TValue val) |
Search for an element with the given key. | |
proto TValue | GetElement (int index) |
Return the i-th element in the map. | |
proto TKey | GetKey (int i) |
Return the i-th element key in the map. | |
proto void | Set (TKey key, TValue value) |
Sets value of element with given key. | |
proto bool | Remove (TKey key) |
proto bool | Take (TKey key, out TValue value) |
Search for an element with the given key and remove it. | |
proto bool | RemoveElement (int i) |
Removes i-th element with given key. | |
proto bool | Contains (TKey key) |
Returns whether map contains element with given key. | |
proto bool | Insert (TKey key, TValue value) |
Insert new element into map. | |
proto int | Copy (map< TKey, TValue > from) |
bool | ReplaceKey (TKey old_key, TKey new_key) |
TKey | GetKeyByValue (TValue value) |
proto native MapIterator | Begin () |
proto native MapIterator | End () |
proto native MapIterator | Next (MapIterator it) |
proto TKey | GetIteratorKey (MapIterator it) |
proto TValue | GetIteratorElement (MapIterator it) |
Public Member Functions inherited from Managed | |
proto external ref Managed | Clone () |
Return shallow copy of object, or null if it is not allowed (not public constructor) | |
Associative array template.
Usage:
proto native MapIterator map< Class TKey, Class TValue >.Begin | ( | ) |
Returns whether map contains element with given key.
proto native MapIterator map< Class TKey, Class TValue >.End | ( | ) |
Search for an element with the given key.
key | The key of the element to find. | |
[out] | val | Destination where result will be stored. |
true
if given key exist. Search for an element with the given key.
key | The key of the element to find. |
Return the i-th element in the map.
index | The position of the element in the map. |
proto TValue map< Class TKey, Class TValue >.GetIteratorElement | ( | MapIterator | it | ) |
proto TKey map< Class TKey, Class TValue >.GetIteratorKey | ( | MapIterator | it | ) |
Return the i-th element key in the map.
i | The position of the element key in the map. |
Insert new element into map.
key | Key of element to be inserted. |
value | Data of element to be inserted. |
true
if the map size is 0, false
otherwise. proto native MapIterator map< Class TKey, Class TValue >.Next | ( | MapIterator | it | ) |
Removes i-th element with given key.
i | The position of the element key in the map. |
true
if element was removed. Sets value of element with given key.
If element with key does not exist, it is created.
Search for an element with the given key and remove it.
key | The key of the element to find and remove. | |
[out] | val | Destination where result will be stored. |
true
if element was removed.