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:

  • name string Name for the Pool.
  • filter table Table containing the required BaseComponents

Returns:

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

Parameters:

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:

    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.
generated by LDoc 1.4.6 Last updated 2020-08-18 15:20:32