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: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.

Metamethods

Pool:__eligible (e) Checks if an Entity is eligible for the Pool.


Methods

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.

Metamethods

Pool:__eligible (e)
Checks if an Entity is eligible for the Pool.

Parameters:

Returns:

    boolean
generated by LDoc 1.4.6 Last updated 2020-01-04 10:27:07