+
+
Class World
+
A collection of Systems and Entities.
+
+ A world emits to let Systems iterate.
+ A World contains any amount of Systems.
+ A World contains any amount of Entities.
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+ World:new ()
+
+ -
+ Creates a new World.
+
+
+
+
Returns:
+
+
+ World
+ The new World
+
+
+
+
+
+
+ -
+
+ World:addEntity (e)
+
+ -
+ Adds an Entity to the World.
+
+
+
Parameters:
+
+ - e
+ Entity
+ Entity to add
+
+
+
+ Returns:
+
+
+ World
+ self
+
+
+
+
+
+
+ -
+
+ World:removeEntity (e)
+
+ -
+ Removes an Entity from the World.
+
+
+
Parameters:
+
+ - e
+ Entity
+ Entity to remove
+
+
+
+ Returns:
+
+
+ World
+ self
+
+
+
+
+
+
+ -
+
+ World:addSystem (systemClass)
+
+ -
+ Adds a System to the World.
+ Callbacks are registered automatically
+ Entities added before are added to the System retroactively
+
+
+
Parameters:
+
+ - systemClass
+ System
+ SystemClass of System to add
+
+
+
+ Returns:
+
+
+ World
+ self
+
+
+
+ See also:
+
+
+
+
+ -
+
+ World:addSystems (...)
+
+ -
+ Adds multiple Systems to the World.
+ Callbacks are registered automatically
+
+
+
Parameters:
+
+ - ...
+ SystemClasses of Systems to add
+
+
+
+ Returns:
+
+
+ World
+ self
+
+
+
+ See also:
+
+
+
+
+ -
+
+ World:hasSystem (systemClass)
+
+ -
+ Returns if the World has a System.
+
+
+
Parameters:
+
+ - systemClass
+ System
+ SystemClass of System to check for
+
+
+
+ Returns:
+
+
+ boolean
+
+
+
+
+
+
+
+ -
+
+ World:getSystem (systemClass)
+
+ -
+ Gets a System from the World.
+
+
+
Parameters:
+
+ - systemClass
+ System
+ SystemClass of System to get
+
+
+
+ Returns:
+
+
+ System
+ System to get
+
+
+
+
+
+
+ -
+
+ World:emit (functionName, ...)
+
+ -
+ Emits a callback in the World.
+ Calls all functions with the functionName of added Systems
+
+
+
Parameters:
+
+ - functionName
+ string
+ Name of functions to call.
+
+ - ...
+ Parameters passed to System's functions
+
+
+
+ Returns:
+
+
+ World
+ self
+
+
+
+
+
+
+ -
+
+ World:clear ()
+
+ -
+ Removes all entities from the World
+
+
+
+
Returns:
+
+
+ World
+ self
+
+
+
+
+
+
+ -
+
+ World:hasName ()
+
+ -
+ Returns true if the World has a name.
+
+
+
+
Returns:
+
+
+ boolean
+
+
+
+
+
+
+
+ -
+
+ World:getName ()
+
+ -
+ Returns the name of the World.
+
+
+
+
Returns:
+
+
+ string
+
+
+
+
+
+
+
+ -
+
+ World:onEntityAdded (e)
+
+ -
+ Callback for when an Entity is added to the World.
+
+
+
Parameters:
+
+ - e
+ Entity
+ The Entity that was added
+
+
+
+
+
+
+
+
+ -
+
+ World:onEntityRemoved (e)
+
+ -
+ Callback for when an Entity is removed from the World.
+
+
+
Parameters:
+
+ - e
+ Entity
+ The Entity that was removed
+
+
+
+
+
+
+
+
+
+
+
+