Class Pool
Used to iterate over Entities with a specific Components
A Pool contain a any amount of Entities.
-
Pool:new (name, filter)
-
Creates a new Pool
Parameters:
- name
string
Name for the Pool.
- filter
table
Table containing the required BaseComponents
Returns:
Pool
The new Pool
-
Pool:getName ()
-
Gets the name of the Pool
Returns:
string
-
Pool:getFilter ()
-
Gets the filter of the Pool.
Warning: Do not modify this filter.
Returns:
Filter of the Pool.
-
Pool:onEntityAdded (e)
-
Callback for when an Entity is added to the Pool.
Parameters:
- e
Entity
Entity that was added.
-
Pool:__eligible (e)
-
Checks if an Entity is eligible for the Pool.
Parameters:
Returns:
boolean