mirror of
https://github.com/Keyslam-Group/Concord.git
synced 2025-09-02 20:33:54 -04:00
Add world:hasSystem, world:getSystem
This commit is contained in:
parent
276a053b7f
commit
2057767e75
1 changed files with 16 additions and 0 deletions
|
@ -109,6 +109,22 @@ function World:flush()
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function World:hasSystem(baseSystem)
|
||||||
|
if not Type.isBaseSystem(baseSystem) then
|
||||||
|
error("bad argument #1 to 'World:getSystem' (baseSystem expected, got "..type(baseSystem)..")", 2)
|
||||||
|
end
|
||||||
|
|
||||||
|
return self.__systemLookup[baseSystem] and true or false
|
||||||
|
end
|
||||||
|
|
||||||
|
function World:getSystem(baseSystem)
|
||||||
|
if not Type.isBaseSystem(baseSystem) then
|
||||||
|
error("bad argument #1 to 'World:getSystem' (baseSystem expected, got "..type(baseSystem)..")", 2)
|
||||||
|
end
|
||||||
|
|
||||||
|
return self.__systemLookup[baseSystem]
|
||||||
|
end
|
||||||
|
|
||||||
--- Adds a System to the World.
|
--- Adds a System to the World.
|
||||||
-- @param baseSystem The BaseSystem of the system to add
|
-- @param baseSystem The BaseSystem of the system to add
|
||||||
-- @param callbackName The callbackName to register to
|
-- @param callbackName The callbackName to register to
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue