Holy shit I just wrote documentation

This commit is contained in:
Justin van der Leij 2018-03-07 11:05:30 +01:00
parent 8810005217
commit 63d8c39b31
9 changed files with 159 additions and 111 deletions

View file

@ -5,6 +5,10 @@ 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)
@ -14,6 +18,9 @@ function Pool.new(name, 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