mirror of
https://github.com/bakpakin/tiny-ecs.git
synced 2026-07-21 23:56:50 -06:00
Change API for activating/deactivating systems. Fix bugs. Update version number.
This commit is contained in:
+4
-6
@@ -140,13 +140,11 @@ describe('tiny-ecs:', function()
|
||||
end)
|
||||
|
||||
it("Disable and Enable Systems", function()
|
||||
world:setSystemActive(moveSystem, false)
|
||||
world:setSystemActive(oneTimeSystem, false)
|
||||
world:deactivate(moveSystem, oneTimeSystem)
|
||||
world:update(1)
|
||||
assert.equals(timePassed, 0)
|
||||
assert.equals(entity1.xform.x, entityTemplate1.xform.x)
|
||||
world:setSystemActive(moveSystem, true)
|
||||
world:setSystemActive(oneTimeSystem, true)
|
||||
world:activate(moveSystem, oneTimeSystem)
|
||||
world:update(1)
|
||||
assert.equals(timePassed, 1)
|
||||
assert.are_not.equal(entity1.xform.x, entityTemplate1.xform.x)
|
||||
@@ -155,13 +153,13 @@ describe('tiny-ecs:', function()
|
||||
it("Clear Entities", function()
|
||||
world:clearEntities()
|
||||
world:update(1)
|
||||
assert.equals(0, world.getEntityCount())
|
||||
assert.equals(0, world:getEntityCount())
|
||||
end)
|
||||
|
||||
it("Clear Systems", function()
|
||||
world:clearSystems()
|
||||
world:update(1)
|
||||
assert.equals(0, world.getSystemCount())
|
||||
assert.equals(0, world:getSystemCount())
|
||||
end)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user