Jump to content

Component Registry: Difference between revisions

From Advanced Computers Wiki
Created page with "The Component Registry allows accessing all currently available Components and is the most convenient way of accessing components. {| class="wikitable" |+ ComponentRegistryUD methods |- ! Name !! Type !! Description |- | style="white-space: nowrap;" | <code>:list()</code> || <code>function -> (string, userdata)</code> || Returns an iterator function that, in each invocation returns a string representing the type of the current component along with the actu..."
 
No edit summary
Line 6: Line 6:
! Name !! Type !! Description
! Name !! Type !! Description
|-
|-
| style="white-space: nowrap;" | <code>:list()</code> || <code>function -> (string, userdata)</code> || Returns an iterator function that, in each invocation returns a string representing the type of the current component along with the actual userdata instance.
| style="white-space: nowrap;" | <code>:list()</code> || <code>iterator -> (string, userdata)</code> || Returns an iterator function that, in each invocation returns a string representing the type of the current component along with the actual userdata instance.
|-
|-
| style="white-space: nowrap;" | <code>:getFirst(componentType:string)</code> || <code>userdata</code>|| Returns the first component of the given <code>componentType</code> or <code>nil</code> if no matching component exists.
| style="white-space: nowrap;" | <code>:getFirst(componentType:string)</code> || <code>userdata</code>|| Returns the first component of the given <code>componentType</code> or <code>nil</code> if no matching component exists.

Revision as of 23:43, 1 August 2026

The Component Registry allows accessing all currently available Components and is the most convenient way of accessing components.

ComponentRegistryUD methods
Name Type Description
:list() iterator -> (string, userdata) Returns an iterator function that, in each invocation returns a string representing the type of the current component along with the actual userdata instance.
:getFirst(componentType:string) userdata Returns the first component of the given componentType or nil if no matching component exists.