Module system

System

Functions

System.new (...) Creates a new System prototype.
System:__buildPool (baseFilter) Builds a Pool for the System.
System:__check (e) Checks and applies an Entity to the System's pools.
System:__remove (e) Removed an Entity from the System.
System:__tryAdd (e) Tries to add an Entity to the System.
System:__tryRemove (e) Tries to remove an Entity from the System.
System:getInstance () Returns the Instance the System is in.
System:__has (e) Returns if the System has the Entity.
System:init (...) Default callback for system initialization.
System:entityAdded (e) Default callback for adding an Entity.
System:entityAddedTo (e, pool) Default callback for adding an Entity to a pool.
System:entityRemoved (e) Default callback for removing an Entity.
System:entityRemovedFrom (e, pool) Default callback for removing an Entity from a pool.


Functions

System.new (...)
Creates a new System prototype.

Parameters:

  • ... Variable amounts of filters

Returns:

    A new System prototype
System:__buildPool (baseFilter)
Builds a Pool for the System.

Parameters:

  • baseFilter The 'raw' Filter

Returns:

    A new Pool
System:__check (e)
Checks and applies an Entity to the System's pools.

Parameters:

  • e The Entity to check

Returns:

    True if the Entity was added, false if it was removed. Nil if nothing happend
System:__remove (e)
Removed an Entity from the System.

Parameters:

  • e The Entity to remove
System:__tryAdd (e)
Tries to add an Entity to the System.

Parameters:

  • e The Entity to add
System:__tryRemove (e)
Tries to remove an Entity from the System.

Parameters:

  • e The Entity to remove
System:getInstance ()
Returns the Instance the System is in.

Returns:

    The Instance
System:__has (e)
Returns if the System has the Entity.

Parameters:

  • e The Entity to check for

Returns:

    True if the System has the Entity. False otherwise
System:init (...)
Default callback for system initialization.

Parameters:

  • ... Varags
System:entityAdded (e)
Default callback for adding an Entity.

Parameters:

  • e The Entity that was added
System:entityAddedTo (e, pool)
Default callback for adding an Entity to a pool.

Parameters:

  • e The Entity that was added
  • pool The pool the Entity was added to
System:entityRemoved (e)
Default callback for removing an Entity.

Parameters:

  • e The Entity that was removed
System:entityRemovedFrom (e, pool)
Default callback for removing an Entity from a pool.

Parameters:

  • e The Entity that was removed
  • pool The pool the Entity was removed from
generated by LDoc 1.4.6 Last updated 2018-09-25 18:42:43