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:
- 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:
Returns:
- Filter:new (name, definition)
-
Creates a new Filter
Parameters:
Returns:
- Filter The new Filter
- Pool The associated Pool
- Filter:eligible (e)
-
Checks if an Entity fulfills the Filter requirements.
Parameters:
- e Entity Entity to check
Returns:
-
boolean
- Filter:getName ()
-
Gets the name of the Filter
Returns: