ContainerProxy
Live proxy for reflected Unreal arrays, maps, and sets.
Reflected TArray, TMap, and TSet properties are live proxies. Mutations update the owning UObject.
Common API
| Operation | Description |
|---|---|
#container | Current entry count. |
pairs(container) | Iterate entries. |
:is_valid() | Whether the owner and property are valid. |
:type() | Returns array, map, or set. |
:get(key) / :set(key, value) | Read or write an entry. |
:remove(key) | Remove an entry. |
:contains(value) | Test membership. |
:clear() | Remove every entry. |
:to_table() | Create a detached Lua snapshot. |
Type-specific methods
- Arrays:
:add(value),:insert(index, value); indices are 1-based. - Maps:
:add(key, value); assigningnilremoves a key. - Sets:
:add(value); assigningfalseornilremoves a member.
Example
local inventory = player.Inventory
inventory:add(new_item)
inventory:insert(1, priority_item)
for index, item in pairs(inventory) do
print(index, item)
endFunction-return containers are detached Lua tables because their native storage is temporary.