From 7053d91c800e6c5a3354645ed30ba28fb0d265df Mon Sep 17 00:00:00 2001 From: Justin van der Leij Date: Wed, 7 Mar 2018 11:53:26 +0100 Subject: [PATCH] Documented :destroy --- fluid/entity.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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