Documented :destroy

This commit is contained in:
Justin van der Leij 2018-03-07 11:53:26 +01:00
parent 4b8b6a6f88
commit 7053d91c80

View file

@ -36,12 +36,6 @@ function Entity:remove(component)
return self return self
end end
function Entity:destroy()
for i = 1, self.instances.size do
self.instances:get(i):removeEntity(self)
end
end
--- Checks the Entity against the pools again. --- Checks the Entity against the pools again.
-- @return self -- @return self
function Entity:apply() function Entity:apply()
@ -56,6 +50,16 @@ function Entity:apply()
return self return self
end end
--- Destroys the Entity.
-- @return self
function Entity:destroy()
for i = 1, self.instances.size do
self.instances:get(i):removeEntity(self)
end
return self
end
--- Gets a Component from the Entity. --- Gets a Component from the Entity.
-- @param component The Component to get -- @param component The Component to get
-- @return The Bag from the Component -- @return The Bag from the Component