Module entity

Entity

Functions

Entity.new () Creates and initializes a new Entity.
Entity:give (component, ...) Gives an Entity a component with values.
Entity:remove (component) Removes a component from an Entity.
Entity:apply () Checks the Entity against the pools again.
Entity:destroy () Destroys the Entity.
Entity:get (component) Gets a Component from the Entity.
Entity:has (component) Returns true if the Entity has the Component.


Functions

Entity.new ()
Creates and initializes a new Entity.

Returns:

    A new Entity
Entity:give (component, ...)
Gives an Entity a component with values.

Parameters:

  • component The Component to add
  • ... The values passed to the Component

Returns:

    self
Entity:remove (component)
Removes a component from an Entity.

Parameters:

  • component The Component to remove

Returns:

    self
Entity:apply ()
Checks the Entity against the pools again.

Returns:

    self
Entity:destroy ()
Destroys the Entity.

Returns:

    self
Entity:get (component)
Gets a Component from the Entity.

Parameters:

  • component The Component to get

Returns:

    The Bag from the Component
Entity:has (component)
Returns true if the Entity has the Component.

Parameters:

  • component The Component to check against

Returns:

    True if the entity has the Bag. False otherwise
generated by LDoc 1.4.6 Last updated 2018-09-25 18:42:43