summaryrefslogtreecommitdiff
path: root/honey/ecs/ecs.lua
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2023-05-12 14:10:48 -0500
committersanine-a <sanine.not@pm.me>2023-05-12 14:10:48 -0500
commit0d96ebc90c9740e7e66a70aa11168b11f49d220b (patch)
tree758403f74f4fbcab61a228ef58e720850b3f70db /honey/ecs/ecs.lua
parent6036d1b5d7e0fc160637ce70595bac57ed1fcd00 (diff)
run working program with refactored code
Diffstat (limited to 'honey/ecs/ecs.lua')
-rw-r--r--honey/ecs/ecs.lua6
1 files changed, 1 insertions, 5 deletions
diff --git a/honey/ecs/ecs.lua b/honey/ecs/ecs.lua
index d7eb4ac..0c84041 100644
--- a/honey/ecs/ecs.lua
+++ b/honey/ecs/ecs.lua
@@ -77,11 +77,9 @@ end
-- load database from file
function EntityDb.load(self, filename)
- print(collectgarbage("count"))
self.entities = {}
self.components = {}
collectgarbage()
- print(collectgarbage("count"))
local env = {
Entity = function(id, components)
self:createEntity(id)
@@ -320,7 +318,6 @@ function SystemDb.update(self, dt)
-- check for dangling dependencies
local dangle = ""
for dependency in pairs(self.dangling) do
- print(dependency)
dangle = dangle .. string.format(
"unresolved dangling dependency: %s\n",
dependency
@@ -330,11 +327,10 @@ function SystemDb.update(self, dt)
error(dangle)
end
-
for _, name in ipairs(self.sort) do
local system = self.systems[name]
local params = self.params[name]
- system.f(self.db, dt, params)
+ system.f(self.entityDb, dt, params)
end
end