Class Pool
Used to iterate over Entities with a specific Components A Pool contain a any amount of Entities.
Methods
Pool:new (name, filter) | Creates a new Pool |
Pool:eligible (e) | Checks if an Entity is eligible for the Pool. |
Pool:evaluate (e) | Evaluate whether an Entity should be added or removed from the Pool. |
Pool:getName () | Gets the name of the Pool |
Pool:getFilter () | Gets the filter of the Pool. |
Pool:onEntityAdded (e) | Callback for when an Entity is added to the Pool. |
Methods
- Pool:new (name, filter)
-
Creates a new Pool
Parameters:
Returns:
-
Pool
The new Pool
- Pool:eligible (e)
-
Checks if an Entity is eligible for the Pool.
Parameters:
- e Entity Entity to check
Returns:
-
boolean
- Pool:evaluate (e)
-
Evaluate whether an Entity should be added or removed from the Pool.
Parameters:
- e Entity to add or remove
Returns:
-
Pool
self
- Pool:getName ()
-
Gets the name of the Pool
Returns:
- 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.