From 1322089adc57a04790bd3e5bb4e446ba647724dd Mon Sep 17 00:00:00 2001 From: Justin van der Leij Date: Fri, 6 Apr 2018 12:30:21 +0200 Subject: [PATCH] Delete pool.lua --- fluid/pool.lua | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 fluid/pool.lua diff --git a/fluid/pool.lua b/fluid/pool.lua deleted file mode 100644 index 678261b..0000000 --- a/fluid/pool.lua +++ /dev/null @@ -1,37 +0,0 @@ -local PATH = (...):gsub('%.[^%.]+$', '') - -local List = require(PATH..".list") - -local Pool = {} -Pool.__index = Pool - ---- Creates a new Pool --- @param name Identifier for the Pool. --- @param filter Table containing the required Components --- @return The new Pool -function Pool.new(name, filter) - local pool = setmetatable(List(), Pool) - - pool.name = name - pool.filter = filter - - return pool -end - ---- Checks if an Entity is eligible for the Pool. --- @param e The Entity to check --- @return True if the entity is eligible, false otherwise -function Pool:eligible(e) - for _, component in ipairs(self.filter) do - if not e.components[component] or e.removed[component] then - return false - end - end - - return true -end - -return setmetatable(Pool, { - __index = List, - __call = function(_, ...) return Pool.new(...) end, -})