Enfusion Script API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
set< Class T > Interface Template Reference
Inheritance diagram for set< Class T >:
[legend]

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)
 

Member Function Documentation

◆ Clear()

proto native void set< Class T >.Clear ( )

Destroys all elements of the array and sets the Count to 0.

The underlying memory of the array is not freed.

◆ Compact()

proto native void set< Class T >.Compact ( )

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.

Warning
Memory allocation and deallocation are expensive so only use this function if you know you won't be adding new items to the array on frame-by-frame basis or when the memory consumption is of upmost importance.

◆ Contains()

proto bool set< Class T >.Contains ( value)

Return if value is in array or not.

Note
This method has complexity O(log n).

◆ Copy()

proto int set< Class T >.Copy ( set< T >  from)

◆ Count()

proto native int set< Class T >.Count ( )

◆ Find()

proto int set< Class T >.Find ( value)

Tries to find the first occurrence of given value in the array.

Returns
Index of the first occurrence of value if found, -1 otherwise.
Note
This method has complexity O(log n).

◆ Get()

proto T set< Class T >.Get ( int  n)

◆ Init()

proto int set< Class T >.Init ( init[])

◆ Insert()

proto bool set< Class T >.Insert ( value)

Inserts element.

Parameters
valueElement to be inserted.
Returns
true when element was inserted, false when it is already in set.

◆ IsEmpty()

proto native bool set< Class T >.IsEmpty ( )
Returns
true if the set size is 0, false otherwise.

◆ IsIndexValid()

proto native bool set< Class T >.IsIndexValid ( int  index)

Returns whether provided element index of set is valid.

◆ Remove()

proto native void set< Class T >.Remove ( int  index)

Removes element from set.

Parameters
indexIndex of element to be removed.

◆ RemoveItem()

proto bool set< Class T >.RemoveItem ( value)

Removes element from set.

Returns
true if item was removed

◆ Reserve()

proto native void set< Class T >.Reserve ( int  newSize)

Reserve memory for given number of elements.

This method is used for optimization purposes when the approximate size is known beforehand.

◆ Swap()

proto native void set< Class T >.Swap ( set< T >  other)

The documentation for this interface was generated from the following file: