Struct ObjectList

object list holder, owning its objects - on destroy of holder, all own objects will be destroyed

struct ObjectList(T);

Fields

NameTypeDescription
_count int
_list T[]

Properties

NameTypeDescription
count[get] intreturns count of items

Methods

NameDescription
add (item) add item to list
asArray () Get items array slice. Don't try to resize it!
clear (destroyObj) remove and destroy all items
get (index) get item by index
indexOf (item) find child index for item, return -1 if not found
indexOf (id) find child index for item by id, return -1 if not found
insert (item, index) add item to list
opApply (callback) Support foreach
opIndex (index) get item by index
remove (index) remove item from list, return removed item
replace (item, index) Replace item with another value, destroy old value.
tryGet (index) get item by index. Returns null if item not found

Aliases

NameDescription
length