Struct ObjectList
object list holder, owning its objects - on destroy of holder, all own objects will be destroyed
struct ObjectList(T);
Fields
| Name | Type | Description |
|---|---|---|
_count
|
int | |
_list
|
T[] |
Properties
| Name | Type | Description |
|---|---|---|
count[get]
|
int | returns count of items |
Methods
| Name | Description |
|---|---|
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
| Name | Description |
|---|---|
length
|