DataRegistry.lua
Function Summary
- DataRegistry.DataObjectIterator()
- Iterates over registered data objects.
- DataRegistry.DestroyDataObject(dataobject_or_name)
- Destroys a registered data object.
- DataRegistry.GetDataObjectByName(dataobjectname)
- Retrieves a data object by name.
- DataRegistry.GetNameByDataObject(dataobject)
- Looks up the name of a data object.
- DataRegistry.NewDataObject(name, dataobj)
- Creates a new data object with the given name.
- DataRegistry.ipairs(dataobject_or_name)
- Iterates over the integer keys stored in a given data object.
- DataRegistry.pairs(dataobject_or_name)
- Iterates over the keys stored in a given data object.
Functions
DataRegistry.DataObjectIterator()
Iterates over registered data objects.
Parameters
Usage
for name, dataobj in DataRegistry.DataObjectIterator() do ... end
Returns
- An iterator for registered data objects.
DataRegistry.DestroyDataObject(dataobject_or_name)
Destroys a registered data object. Fires a callback to inform listeners of the data object's destruction.
Parameters
dataobject_or_name
: The data object to be destroyed, or its registered name.
DataRegistry.GetDataObjectByName(dataobjectname)
Retrieves a data object by name.
Parameters
dataobjectname
: The name of the object.
Returns
- The data object registered by the given name, if found.
DataRegistry.GetNameByDataObject(dataobject)
Looks up the name of a data object.
Parameters
dataobject
: A data object to look up.
Returns
- The name of the data object, if found.
DataRegistry.NewDataObject(name, dataobj)
Creates a new data object with the given name. Fires a callback to inform listeners of the new data object. If a table is passed as the second arg, its values are stored in the new data object before the callback is fired.
Parameters
name
: Name of the new data object.dataobj
: Optional table containing initial state for the data object.
Returns
- The newly created object.
DataRegistry.ipairs(dataobject_or_name)
Iterates over the integer keys stored in a given data object. Use this instead of ipairs() on registered data objects.
Parameters
dataobject_or_name
: The data object to iterate, or its registered name.
Returns
- An iterator for integer keys in the given data object.