Enfusion Script API
|
Public Member Functions | |
proto native int | Count () |
proto native bool | IsEmpty () |
proto native void | Clear () |
Destroys all elements of the array and sets the Count to 0. | |
proto native void | Compact () |
Frees any underlying memory which is not used. | |
proto native void | Reserve (int newSize) |
Reserve memory for given number of elements. | |
proto int | Find (T value) |
Tries to find the first occurrence of given value in the array. | |
proto bool | Contains (T value) |
Return if value is in array or not. | |
proto T | Get (int n) |
proto bool | Insert (T value) |
Inserts element. | |
proto native void | Remove (int index) |
Removes element from set. | |
proto bool | RemoveItem (T value) |
Removes element from set. | |
proto native bool | IsIndexValid (int index) |
Returns whether provided element index of set is valid. | |
proto int | Copy (set< T > from) |
proto native void | Swap (set< T > other) |
proto int | Init (T init[]) |
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) | |
Destroys all elements of the array and sets the Count to 0.
The underlying memory of the array is not freed.
Frees any underlying memory which is not used.
For example, if the set allocated enough memory for 100 items but only 1 is used (Count() is 1) this frees the memory taken by the remaining 99 items.
Return if value is in array or not.
Tries to find the first occurrence of given value in the array.
value
if found, -1 otherwise. Inserts element.
value | Element to be inserted. |
true
when element was inserted, false
when it is already in set. Returns whether provided element index of set is valid.
Removes element from set.
index | Index of element to be removed. |
Removes element from set.
Reserve memory for given number of elements.
This method is used for optimization purposes when the approximate size is known beforehand.