Class Filter

Used to filter Entities with specific Components A Filter has an associated Pool that can contain any amount of Entities.

Methods

Filter:validate (name, definition, Optional) Validates a Filter Definition to make sure every component is valid.
Filter:parse (name, definition) Parses the Filter Defintion into two tables required: An array of all the required component names.
Filter:new (name, definition) Creates a new Filter
Filter:eligible (e) Checks if an Entity fulfills the Filter requirements.
Filter:getName () Gets the name of the Filter


Methods

Filter:validate (name, definition, Optional)
Validates a Filter Definition to make sure every component is valid.

Parameters:

  • name string Name for the Filter.
  • definition table Table containing the Filter Definition
  • Optional onComponent function, called when a component is valid.
Filter:parse (name, definition)
Parses the Filter Defintion into two tables required: An array of all the required component names. rejected: An array of all the components that will be rejected.

Parameters:

  • name string Name for the Filter.
  • definition table Table containing the Filter Definition

Returns:

  1. table required
  2. table rejected
Filter:new (name, definition)
Creates a new Filter

Parameters:

  • name string Name for the Filter.
  • definition table Table containing the Filter Definition

Returns:

  1. Filter The new Filter
  2. Pool The associated Pool
Filter:eligible (e)
Checks if an Entity fulfills the Filter requirements.

Parameters:

Returns:

    boolean
Filter:getName ()
Gets the name of the Filter

Returns:

    string
generated by LDoc 1.4.6 Last updated 2023-02-26 15:29:07