mirror of
https://github.com/Keyslam-Group/Concord.git
synced 2025-09-02 12:24:11 -04:00
Add helper functions to container. Allow name to be gotten
This commit is contained in:
parent
6cd66e6737
commit
55ae5fd987
8 changed files with 97 additions and 2 deletions
|
@ -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, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue