mirror of
https://github.com/Keyslam-Group/Concord.git
synced 2025-08-31 01:18:29 -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
|
@ -53,8 +53,10 @@ System.mt = {
|
|||
-- @return A new SystemClass
|
||||
function System.new(...)
|
||||
local systemClass = setmetatable({
|
||||
__isSystemClass = true,
|
||||
__filter = {...},
|
||||
|
||||
__name = nil,
|
||||
__isSystemClass = true,
|
||||
}, System.mt)
|
||||
systemClass.__index = systemClass
|
||||
|
||||
|
@ -178,6 +180,18 @@ function System:getWorld()
|
|||
return self.__world
|
||||
end
|
||||
|
||||
--- Returns true if the System has a name.
|
||||
-- @return True if the System has a name, false otherwise
|
||||
function System:hasName()
|
||||
return self.__name and true or false
|
||||
end
|
||||
|
||||
--- Returns the name of the System.
|
||||
-- @return Name of the System
|
||||
function System:getName()
|
||||
return self.__name
|
||||
end
|
||||
|
||||
--- Callback for system initialization.
|
||||
-- @param world The World the System was added to
|
||||
function System:init(world) -- luacheck: ignore
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue