Add helper functions to container. Allow name to be gotten

This commit is contained in:
Tjakka5 2020-01-04 13:40:18 +01:00
parent 6cd66e6737
commit 55ae5fd987
8 changed files with 97 additions and 2 deletions

View file

@ -24,6 +24,21 @@ function Systems.register(name, systemClass)
end
Systems[name] = systemClass
systemClass.__name = name
end
--- Returns true if the containter has the SystemClass with the name
-- @param name Name of the SystemClass to check
-- @return True if the containter has the SystemClass with the name, false otherwise
function Systems.has(name)
return Systems[name] and true or false
end
--- Returns the SystemClass with the name
-- @param name Name of the SystemClass to get
-- @return SystemClass with the name
function Systems.get(name)
return Systems[name]
end
return setmetatable(Systems, {