modules/world: add a way of counting actors
This commit is contained in:
parent
5a65b1ec0a
commit
8ba5644fb2
1 changed files with 4 additions and 0 deletions
|
@ -10,6 +10,10 @@ function BaseWorld:registerEntity(entity)
|
|||
table.insert(self.entities, entity)
|
||||
end
|
||||
|
||||
function BaseWorld:countEntity()
|
||||
return #self.entities
|
||||
end
|
||||
|
||||
function BaseWorld:update(dt)
|
||||
for i,v in ipairs(self.entities) do
|
||||
v:update(dt)
|
||||
|
|
Loading…
Reference in a new issue