Begin experimental option to not use caching.

This commit is contained in:
bakpakin
2016-03-06 14:42:48 -05:00
parent cbf71d2cb2
commit 08e5f13d85
2 changed files with 129 additions and 82 deletions
+4 -2
View File
@@ -233,9 +233,11 @@ describe('tiny-ecs:', function()
end)
it("Remove Entities Multiple Times", function()
assert.equals(3, world:getEntityCount())
world:update(1)
world:remove(entity1, entity2, entity3)
world:update(2)
assert.equals(0, world:getEntityCount())
world:remove(entity1, entity2, entity3)
world:update(2)
assert.equals(2, world:getSystemCount())
@@ -270,12 +272,12 @@ describe('tiny-ecs:', function()
it("Sorts Entities in Sorting Systems", function()
local sortsys = tiny.sortedProcessingSystem()
sortsys.filter = tiny.requireAll("vel")
sortsys.filter = tiny.filter("vel|xform")
function sortsys:compare(e1, e2)
return e1.vel.x < e2.vel.x
end
world:add(sortsys)
world:update(0)
world:refresh()
assert.equals(sortsys.entities[1], entity2)
assert.equals(sortsys.entities[2], entity3)
assert.equals(sortsys.entities[3], entity1)