modules/world: use only the "actor" name

This commit is contained in:
Kazhnuz 2019-04-01 13:09:21 +02:00
parent c50f71f244
commit 3fce24a211

View file

@ -3,25 +3,25 @@ local BaseWorld = Object:extend()
function BaseWorld:new(scene)
self.scene = scene
self.entities = {}
self.actors = {}
end
function BaseWorld:registerEntity(entity)
table.insert(self.entities, entity)
function BaseWorld:registerActor(actor)
table.insert(self.actors, actor)
end
function BaseWorld:countEntity()
return #self.entities
function BaseWorld:countActors()
return #self.actors
end
function BaseWorld:update(dt)
for i,v in ipairs(self.entities) do
for i,v in ipairs(self.actors) do
v:update(dt)
end
end
function BaseWorld:draw(dt)
for i,v in ipairs(self.entities) do
for i,v in ipairs(self.actors) do
v:draw(dt)
end
end