modules/world: add a way of counting actors

This commit is contained in:
Kazhnuz 2019-04-01 12:47:08 +02:00
parent 5a65b1ec0a
commit 8ba5644fb2

View file

@ -10,6 +10,10 @@ function BaseWorld:registerEntity(entity)
table.insert(self.entities, entity) table.insert(self.entities, entity)
end end
function BaseWorld:countEntity()
return #self.entities
end
function BaseWorld:update(dt) function BaseWorld:update(dt)
for i,v in ipairs(self.entities) do for i,v in ipairs(self.entities) do
v:update(dt) v:update(dt)