mirror of
https://github.com/Keyslam-Group/Concord.git
synced 2025-09-01 11:53:57 -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 Worlds.register(name, world)
|
|||
end
|
||||
|
||||
Worlds[name] = world
|
||||
world.__name = name
|
||||
end
|
||||
|
||||
--- Returns true if the containter has the World with the name
|
||||
-- @param name Name of the World to check
|
||||
-- @return True if the containter has the World with the name, false otherwise
|
||||
function Worlds.has(name)
|
||||
return Worlds[name] and true or false
|
||||
end
|
||||
|
||||
--- Returns the World with the name
|
||||
-- @param name Name of the World to get
|
||||
-- @return World with the name
|
||||
function Worlds.get(name)
|
||||
return Worlds[name]
|
||||
end
|
||||
|
||||
return setmetatable(Worlds, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue