JD2022-TU1/data/EngineData/Helpers/autonomous.ilu

18 lines
No EOL
516 B
Text

-- Creates an object that will dynamically add nodes when necessary --
function create_autonomous_object()
return setmetatable({},
{
__index = index_event
});
end
-- Index event handler. It will create a new table when it doesn't exist on the autonomous object --
function index_event(tab, key)
local newTab = create_autonomous_object();
rawset(tab, key, newTab);
return newTab;
end
-- Create your root autonomous objects here --
component = create_autonomous_object();
params = create_autonomous_object();