summaryrefslogtreecommitdiff
path: root/honey/ecs.lua
diff options
context:
space:
mode:
Diffstat (limited to 'honey/ecs.lua')
-rw-r--r--honey/ecs.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/honey/ecs.lua b/honey/ecs.lua
index 260c389..b0409e4 100644
--- a/honey/ecs.lua
+++ b/honey/ecs.lua
@@ -146,6 +146,14 @@ function EntityDb.addComponents(self, id, components)
end
+-- create an entity with components
+function EntityDb.createEntityWithComponents(self, components)
+ local id = self:createEntity()
+ self:addComponents(id, components)
+ return id
+end
+
+
-- get all entities with a given component
function EntityDb.queryComponent(self, name)
local component = self.components[name]