ecs = require "ecs"
Gets all the Entities with a given component.
ecs.getEntities(component)
string
component
The type of component.
Creates a new Entity
.
entity = ecs.newEntity()
Adds a component and its data to the Entity. Returns the data from the added component.
Entity:add(component, data)
string
component
The type of component.value
data
The data of the component.
Destroys the Entity.
Entity:destroy()
Gets the data for a given component from the Entity.
Entity:get(component)
string
component
The type of component.
Whether the Entity has a given component.
Entity:has(component)
string
component
The type of component.
Removes the component from the Entity.
Entity:remove(component)
string
component
The type of component.