HolyLib Wiki

EntityList

EntityList

This class should remove some overhead to improve performance since you can pass it to some functions.
It is also used by other modules to improve their performance if they have to loop thru all entities or push entities to lua.

Metatable function Description
__tostring Returns a formated string of the EntityList -> EntityList [entity count]
__index Used to allow one to access saved lua data on the object
__newindex Used to allow one to save lua data on the object
__gc Deletes the class & frees all internal references

Methods

EntityList:AddEntities( table entities )
Adds the entities from the given table to the Entity list.
EntityList:AddEntity( Entity entity )
Adds the given entity to the list.
table EntityList:GetEntities( )
Returns a table with all the entities.
table EntityList:GetTable( )
Returns the lua table used by newindex and index
boolean EntityList:IsValid( )
Returns weather this object is valid or not.
EntityList:RemoveEntities( table entities )
Removes the entities that are in the table from the Entity list.
EntityList:RemoveEntity( Entity entity )
Removes the given entity from the list.
EntityList:SetEntities( table entities )
Sets the EntityList from the given table.