unreal.TypedElementList

class unreal.TypedElementList

Bases: unreal.StructBase

A list of script element handles (proxy to a FScriptTypedElementList instance). Provides high-level access to groups of elements, including accessing elements that implement specific interfaces.

Note: the script list proxy use should be avoided when not using it for the script exposure apis. The weak model for the handles come with an additional cost to the runtime performance and the memory usage.

C++ Source:

  • Module: TypedElementFramework

  • File: TypedElementListProxy.h

add(element_handle) bool

Add the given element handle to this element list, if it isn’t already in the list.

Parameters

element_handle (ScriptTypedElementHandle) –

Returns

True if the element handle was added, false if it is already in the list.

Return type

bool

append(element_handles) None

Append the given element handles to this element list.

Parameters

element_handles (Array(ScriptTypedElementHandle)) –

append_list(other_element_list) None

Append the another element list to this element list.

Parameters

other_element_list (TypedElementList) –

clone() TypedElementList

Clone this list instance. note: Only copies elements; does not copy any bindings!

Return type

TypedElementList

contains(element_handle) bool

Does this element list contain an entry for the given element handle?

Parameters

element_handle (ScriptTypedElementHandle) –

Return type

bool

count_elements(base_interface_type=None) int32

Count the number of elements in this list, optionally filtering to elements that implement the given interface.

Parameters

base_interface_type (type(Class)) –

Return type

int32

count_elements_of_type(element_type_name) int32

Count the number of elements in this list of the given type.

Parameters

element_type_name (Name) –

Return type

int32

empty(slack=0) None

Remove all entries from this element list, potentially leaving space allocated for the given number of entries.

Parameters

slack (int32) –

get_element_handle_at(index) ScriptTypedElementHandle

Get the element handle at the given index. note: Use IsValidIndex to test for validity.

Parameters

index (int32) –

Return type

ScriptTypedElementHandle

get_element_handles(base_interface_type)

Get the handle of every element in this list, optionally filtering to elements that implement the given interface.

Parameters

base_interface_type (type(Class)) –

Return type

Array(ScriptTypedElementHandle)

get_element_interface(element_handle, base_interface_type) Object

Get the element interface from the given handle.

Parameters
Return type

Object

has_elements(base_interface_type=None) bool

Test whether there are elements in this list, optionally filtering to elements that implement the given interface.

Parameters

base_interface_type (type(Class)) –

Return type

bool

has_elements_of_type(element_type_name) bool

Test whether there are elements in this list of the given type.

Parameters

element_type_name (Name) –

Return type

bool

is_valid_index(index) bool

Is the given index a valid entry within this element list?

Parameters

index (int32) –

Return type

bool

num() int32

Get the number of entries within this element list.

Return type

int32

remove(element_handle) bool

Remove the given element handle from this element list, if it is in the list.

Parameters

element_handle (ScriptTypedElementHandle) –

Returns

True if the element handle was removed, false if it isn’t in the list.

Return type

bool

reserve(size) None

Pre-allocate enough memory in this element list to store the given number of entries.

Parameters

size (int32) –

reset() None

Remove all entries from this element list, preserving existing allocations.

shrink() None

Shrink this element list storage to avoid slack.