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

@ -33,6 +33,7 @@ function World.new()
__systemLookup = {},
__name = nil,
__isWorld = true,
}, World.__mt)
@ -316,6 +317,18 @@ function World:deserialize(data, append)
self:__flush()
end
--- Returns true if the World has a name.
-- @return True if the World has a name, false otherwise
function World:hasName()
return self.__name and true or false
end
--- Returns the name of the World.
-- @return Name of the World
function World:getName()
return self.__name
end
--- Callback for when an Entity is added to the World.
-- @param e The Entity that was added
function World:onEntityAdded(e) -- luacheck: ignore