diff --git a/fluid/entity.lua b/fluid/entity.lua index 5c8a224..360d03f 100644 --- a/fluid/entity.lua +++ b/fluid/entity.lua @@ -36,12 +36,6 @@ function Entity:remove(component) return self 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. -- @return self function Entity:apply() @@ -56,6 +50,16 @@ function Entity:apply() return self 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. -- @param component The Component to get -- @return The Bag from the Component