make the docs a little nicer

main changes:
- add parameter and return types where applicable
- use @module and @classmod tags at the top of files
- remove some redundant descriptions of return values, especially for functions that return a boolean

recommended next steps:
- more consistent grammar
- add links to classes and functions in descriptions where appropriate
- be consistent about naming Systems vs. SystemClasses and Components vs. ComponentClasses
This commit is contained in:
Andrew Minnich 2020-01-04 10:31:05 -05:00
parent 55ae5fd987
commit a65f88dd5e
31 changed files with 1474 additions and 1147 deletions

View file

@ -1,6 +1,5 @@
--- Assemblage
-- An Assemblage is a function that 'makes' an entity something.
-- It does this by :give'ing or :ensure'ing Components, or by :assemble'ing the Entity.
--- Gives an entity a set of components.
-- @classmod Assemblage
local Assemblage = {}
Assemblage.__mt = {
@ -8,8 +7,8 @@ Assemblage.__mt = {
}
--- Creates a new Assemblage.
-- @param assemble Function that assembles an Entity
-- @return A new Assemblage
-- @tparam function assemble Function that assembles an Entity
-- @treturn Assemblage A new assemblage
function Assemblage.new(assemble)
local assemblage = setmetatable({
__assemble = assemble,
@ -22,9 +21,9 @@ function Assemblage.new(assemble)
end
--- Assembles an Entity.
-- @param e Entity to assemble
-- @param ... Varargs to pass to the assemble function
-- @ return self
-- @tparam Entity e Entity to assemble
-- @param ... additional arguments to pass to the assemble function
-- @treturn Assemblage self
function Assemblage:assemble(e, ...)
self.__assemble(e, ...)
@ -32,13 +31,13 @@ function Assemblage:assemble(e, ...)
end
--- Returns true if the Assemblage has a name.
-- @return True if the Assemblage has a name, false otherwise
-- @treturn boolean
function Assemblage:hasName()
return self.__name and true or false
end
--- Returns the name of the Assemblage.
-- @return Name of the Assemblage
-- @treturn string
function Assemblage:getName()
return self.__name
end

View file

@ -1,5 +1,5 @@
--- Assemblages
-- Container for registered Assemblages
--- A container for registered @{Assemblage}s
-- @module Assemblages
local PATH = (...):gsub('%.[^%.]+$', '')
@ -8,8 +8,8 @@ local Type = require(PATH..".type")
local Assemblages = {}
--- Registers an Assemblage.
-- @param name Name to register under
-- @param assemblage Assemblage to register
-- @string name Name to register under
-- @tparam Assemblage assemblage Assemblage to register
function Assemblages.register(name, assemblage)
if (type(name) ~= "string") then
error("bad argument #1 to 'Assemblages.register' (string expected, got "..type(name)..")", 3)
@ -27,16 +27,16 @@ function Assemblages.register(name, assemblage)
assemblage.__name = name
end
--- Returns true if the containter has the Assemblage with the name
-- @param name Name of the Assemblage to check
-- @return True if the containter has the Assemblage with the name, false otherwise
--- Returns true if the containter has an Assemblage with the specified name
-- @string name Name of the Assemblage to check
-- @treturn boolean
function Assemblages.has(name)
return Assemblages[name] and true or false
end
--- Returns the Assemblage with the name
-- @param name Name of the Assemblage to get
-- @return Assemblage with the name
--- Returns the Assemblage with the specified name
-- @string name Name of the Assemblage to get
-- @treturn Assemblage
function Assemblages.get(name)
return Assemblages[name]
end
@ -46,4 +46,4 @@ return setmetatable(Assemblages, {
__index = function(_, name)
error("Attempt to index assemblage '"..tostring(name).."' that does not exist / was not registered", 2)
end
})
})

View file

@ -1,6 +1,5 @@
--- Component
-- A Component is a pure data container.
-- A Component is contained by a single entity.
--- A pure data container that is contained by a single entity.
-- @classmod Component
local Component = {}
Component.__mt = {
@ -8,8 +7,8 @@ Component.__mt = {
}
--- Creates a new ComponentClass.
-- @param populate Function that populates a Component with values
-- @return A new ComponentClass
-- @tparam function populate Function that populates a Component with values
-- @treturn Component A new ComponentClass
function Component.new(populate)
if (type(populate) ~= "function" and type(populate) ~= "nil") then
error("bad argument #1 to 'Component.new' (function/nil expected, got "..type(populate)..")", 2)
@ -29,7 +28,7 @@ function Component.new(populate)
return componentClass
end
--- Internal: Populates a Component with values
-- Internal: Populates a Component with values
function Component:__populate() -- luacheck: ignore
end
@ -39,7 +38,7 @@ end
function Component:deserialize(data) -- luacheck: ignore
end
--- Internal: Creates a new Component.
-- Internal: Creates a new Component.
-- @return A new Component
function Component:__new()
local component = setmetatable({
@ -52,7 +51,7 @@ function Component:__new()
return component
end
--- Internal: Creates and populates a new Component.
-- Internal: Creates and populates a new Component.
-- @param ... Varargs passed to the populate function
-- @return A new populated Component
function Component:__initialize(...)
@ -64,13 +63,13 @@ function Component:__initialize(...)
end
--- Returns true if the Component has a name.
-- @return True if the Component has a name, false otherwise
-- @treturn boolean
function Component:hasName()
return self.__name and true or false
end
--- Returns the name of the Component.
-- @return Name of the Component
-- @treturn string
function Component:getName()
return self.__name
end
@ -79,4 +78,4 @@ return setmetatable(Component, {
__call = function(_, ...)
return Component.new(...)
end,
})
})

View file

@ -1,5 +1,5 @@
--- Components
-- Container for registered ComponentClasss
--- Container for registered ComponentClasses
-- @module Components
local PATH = (...):gsub('%.[^%.]+$', '')
@ -8,8 +8,8 @@ local Type = require(PATH..".type")
local Components = {}
--- Registers a ComponentClass.
-- @param name Name to register under
-- @param componentClass ComponentClass to register
-- @string name Name to register under
-- @tparam Component componentClass ComponentClass to register
function Components.register(name, componentClass)
if (type(name) ~= "string") then
error("bad argument #1 to 'Components.register' (string expected, got "..type(name)..")", 3)
@ -27,16 +27,16 @@ function Components.register(name, componentClass)
componentClass.__name = name
end
--- Returns true if the containter has the ComponentClass with the name
-- @param name Name of the ComponentClass to check
-- @return True if the containter has the ComponentClass with the name, false otherwise
--- Returns true if the containter has the ComponentClass with the specified name
-- @string name Name of the ComponentClass to check
-- @treturn boolean
function Components.has(name)
return Components[name] and true or false
end
--- Returns the ComponentClass with the name
-- @param name Name of the ComponentClass to get
-- @return ComponentClass with the name
--- Returns the ComponentClass with the specified name
-- @string name Name of the ComponentClass to get
-- @treturn Component
function Components.get(name)
return Components[name]
end
@ -45,4 +45,4 @@ return setmetatable(Components, {
__index = function(_, name)
error("Attempt to index ComponentClass '"..tostring(name).."' that does not exist / was not registered", 2)
end
})
})

View file

@ -1,7 +1,6 @@
--- Entity
-- Entities are the concrete objects that exist in your project.
-- An Entity have Components and are processed by Systems.
-- An Entity is contained by a maximum of 1 World.
--- An object that exists in a world. An entity
-- contains components which are processed by systems.
-- @classmod Entity
local PATH = (...):gsub('%.[^%.]+$', '')
@ -14,8 +13,8 @@ Entity.__mt = {
}
--- Creates a new Entity. Optionally adds it to a World.
-- @param world Optional World to add the entity to
-- @return A new Entity
-- @tparam[opt] World world World to add the entity to
-- @treturn Entity A new Entity
function Entity.new(world)
if (world ~= nil and not Type.isWorld(world)) then
error("bad argument #1 to 'Entity.new' (world/nil expected, got "..type(world)..")", 2)
@ -53,9 +52,9 @@ end
--- Gives an Entity a Component.
-- If the Component already exists, it's overridden by this new Component
-- @param componentClass ComponentClass to add an instance of
-- @param ... varargs passed to the Component's populate function
-- @return self
-- @tparam Component componentClass ComponentClass to add an instance of
-- @param ... additional arguments to pass to the Component's populate function
-- @treturn Entity self
function Entity:give(componentClass, ...)
if not Type.isComponentClass(componentClass) then
error("bad argument #1 to 'Entity:give' (ComponentClass expected, got "..type(componentClass)..")", 2)
@ -68,9 +67,9 @@ end
--- Ensures an Entity to have a Component.
-- If the Component already exists, no action is taken
-- @param componentClass ComponentClass to add an instance of
-- @param ... varargs passed to the Component's populate function
-- @return self
-- @tparam Component componentClass ComponentClass to add an instance of
-- @param ... additional arguments to pass to the Component's populate function
-- @treturn Entity self
function Entity:ensure(componentClass, ...)
if not Type.isComponentClass(componentClass) then
error("bad argument #1 to 'Entity:ensure' (ComponentClass expected, got "..type(componentClass)..")", 2)
@ -86,8 +85,8 @@ function Entity:ensure(componentClass, ...)
end
--- Removes a Component from an Entity.
-- @param componentClass ComponentClass of the Component to remove
-- @return self
-- @tparam Component componentClass ComponentClass of the Component to remove
-- @treturn Entity self
function Entity:remove(componentClass)
if not Type.isComponentClass(componentClass) then
error("bad argument #1 to 'Entity:remove' (ComponentClass expected, got "..type(componentClass)..")")
@ -99,8 +98,9 @@ function Entity:remove(componentClass)
end
--- Assembles an Entity.
-- @param assemblage Assemblage to assemble with
-- @param ... Varargs to pass to the Assemblage's assemble function.
-- @tparam Assemblage assemblage Assemblage to assemble with
-- @param ... additional arguments to pass to the Assemblage's assemble function.
-- @treturn Entity self
function Entity:assemble(assemblage, ...)
if not Type.isAssemblage(assemblage) then
error("bad argument #1 to 'Entity:assemble' (Assemblage expected, got "..type(assemblage)..")")
@ -112,7 +112,7 @@ function Entity:assemble(assemblage, ...)
end
--- Destroys the Entity.
-- Removes the Entity from it's World if it's in one.
-- Removes the Entity from its World if it's in one.
-- @return self
function Entity:destroy()
if self.__world then
@ -122,7 +122,7 @@ function Entity:destroy()
return self
end
--- Internal: Tells the World it's in that this Entity is dirty.
-- Internal: Tells the World it's in that this Entity is dirty.
-- @return self
function Entity:__dirty()
if self.__world then
@ -133,8 +133,8 @@ function Entity:__dirty()
end
--- Returns true if the Entity has a Component.
-- @param componentClass ComponentClass of the Component to check
-- @return True if the Entity has the Component, false otherwise
-- @tparam Component componentClass ComponentClass of the Component to check
-- @treturn boolean
function Entity:has(componentClass)
if not Type.isComponentClass(componentClass) then
error("bad argument #1 to 'Entity:has' (ComponentClass expected, got "..type(componentClass)..")")
@ -144,8 +144,8 @@ function Entity:has(componentClass)
end
--- Gets a Component from the Entity.
-- @param componentClass ComponentClass of the Component to get
-- @return The Component
-- @tparam Component componentClass ComponentClass of the Component to get
-- @treturn table
function Entity:get(componentClass)
if not Type.isComponentClass(componentClass) then
error("bad argument #1 to 'Entity:get' (ComponentClass expected, got "..type(componentClass)..")")
@ -157,19 +157,19 @@ end
--- Returns a table of all Components the Entity has.
-- Warning: Do not modify this table.
-- Use Entity:give/ensure/remove instead
-- @return Table of all Components the Entity has
-- @treturn table Table of all Components the Entity has
function Entity:getComponents()
return self.__components
end
--- Returns true if the Entity is in a World.
-- @return True if the Entity is in a World, false otherwise
-- @treturn boolean
function Entity:inWorld()
return self.__world and true or false
end
--- Returns the World the Entity is in.
-- @return The World the Entity is in.
-- @treturn World
function Entity:getWorld()
return self.__world
end
@ -213,4 +213,4 @@ return setmetatable(Entity, {
__call = function(_, ...)
return Entity.new(...)
end,
})
})

View file

@ -1,4 +1,5 @@
--- init
---
-- @module Concord
local PATH = (...):gsub('%.init$', '')

View file

@ -1,5 +1,5 @@
--- List
-- Data structure that allows for fast removal at the cost of containing order.
--- Data structure that allows for fast removal at the cost of containing order.
-- @classmod List
local List = {}
List.__mt = {
@ -7,7 +7,7 @@ List.__mt = {
}
--- Creates a new List.
-- @return A new List
-- @treturn List A new List
function List.new()
return setmetatable({
size = 0,
@ -18,7 +18,7 @@ end
-- Object must be of reference type
-- Object may not be the string 'size'
-- @param obj Object to add
-- @return self
-- @treturn List self
function List:__add(obj)
local size = self.size + 1
@ -31,7 +31,7 @@ end
--- Removes an object from the List.
-- @param obj Object to remove
-- @return self
-- @treturn List self
function List:__remove(obj)
local index = self[obj]
if not index then return end
@ -55,7 +55,7 @@ function List:__remove(obj)
end
--- Clears the List completely.
-- @return self
-- @treturn List self
function List:__clear()
for i = 1, self.size do
local o = self[i]
@ -71,13 +71,13 @@ end
--- Returns true if the List has the object.
-- @param obj Object to check for
-- @return True if the List has the object, false otherwise
-- @treturn boolean
function List:has(obj)
return self[obj] and true or false
end
--- Returns the object at an index.
-- @param i Index to get from
-- @number i Index to get from
-- @return Object at the index
function List:get(i)
return self[i]
@ -85,7 +85,7 @@ end
--- Returns the index of an object in the List.
-- @param obj Object to get index of
-- @return index of object in the List.
-- @treturn number index of object in the List.
function List:indexOf(obj)
if (not self[obj]) then
error("bad argument #1 to 'List:indexOf' (Object was not in List)", 2)

View file

@ -1,6 +1,6 @@
--- Pool
-- A Pool is used to iterate over Entities with a specific Components
--- Used to iterate over Entities with a specific Components
-- A Pool contain a any amount of Entities.
-- @classmod Pool
local PATH = (...):gsub('%.[^%.]+$', '')
@ -12,9 +12,9 @@ Pool.__mt = {
}
--- Creates a new Pool
-- @param name Name for the Pool.
-- @param filter Table containing the required BaseComponents
-- @return The new Pool
-- @string name Name for the Pool.
-- @tparam table filter Table containing the required BaseComponents
-- @treturn Pool The new Pool
function Pool.new(name, filter)
local pool = setmetatable(List(), Pool.__mt)
@ -27,8 +27,8 @@ function Pool.new(name, filter)
end
--- Checks if an Entity is eligible for the Pool.
-- @param e Entity to check
-- @return True if the entity is eligible, false otherwise
-- @tparam Entity e Entity to check
-- @treturn boolean
function Pool:__eligible(e)
for _, component in ipairs(self.__filter) do
if not e[component] then
@ -39,9 +39,9 @@ function Pool:__eligible(e)
return true
end
--- Internal: Adds an Entity to the Pool.
-- Internal: Adds an Entity to the Pool.
-- @param e Entity to add
-- @return self
-- @treturn Pool self
function Pool:__add(e)
List.__add(self, e)
self:onEntityAdded(e)
@ -49,9 +49,9 @@ function Pool:__add(e)
return self
end
--- Internal: Removed an Entity from the Pool.
-- Internal: Removed an Entity from the Pool.
-- @param e Entity to remove
-- @return self
-- @treturn Pool self
function Pool:__remove(e)
List.__remove(self, e)
self:onEntityRemoved(e)
@ -60,7 +60,7 @@ function Pool:__remove(e)
end
--- Gets the name of the Pool
-- @return Name of the Pool.
-- @treturn string
function Pool:getName()
return self.__name
end
@ -73,12 +73,12 @@ function Pool:getFilter()
end
--- Callback for when an Entity is added to the Pool.
-- @param e Entity that was added.
-- @tparam Entity e Entity that was added.
function Pool:onEntityAdded(e) -- luacheck: ignore
end
-- Callback for when an Entity is removed from the Pool.
-- @param e Entity that was removed.
-- @tparam Entity e Entity that was removed.
function Pool:onEntityRemoved(e) -- luacheck: ignore
end

View file

@ -1,7 +1,7 @@
--- System
-- A System iterates over Entities. From these Entities its get Components and modify them.
--- Iterates over Entities. From these Entities its get Components and modify them.
-- A System contains 1 or more Pools.
-- A System is contained by 1 World.
-- @classmod System
local PATH = (...):gsub('%.[^%.]+$', '')
@ -50,7 +50,7 @@ System.mt = {
--- Creates a new SystemClass.
-- @param ... Variable amounts of filters
-- @return A new SystemClass
-- @treturn System A new SystemClass
function System.new(...)
local systemClass = setmetatable({
__filter = {...},
@ -70,7 +70,7 @@ function System.new(...)
return systemClass
end
--- Internal: Builds a Pool for the System.
-- Internal: Builds a Pool for the System.
-- @param baseFilter The 'raw' Filter
-- @return A new Pool
function System.__buildPool(baseFilter)
@ -88,9 +88,9 @@ function System.__buildPool(baseFilter)
return Pool(name, filter)
end
--- Internal: Evaluates an Entity for all the System's Pools.
-- Internal: Evaluates an Entity for all the System's Pools.
-- @param e The Entity to check
-- @return self
-- @treturn System self
function System:__evaluate(e)
for _, pool in ipairs(self.__pools) do
local has = pool:has(e)
@ -106,9 +106,9 @@ function System:__evaluate(e)
return self
end
--- Internal: Removes an Entity from the System.
-- Internal: Removes an Entity from the System.
-- @param e The Entity to remove
-- @return self
-- @treturn System self
function System:__remove(e)
for _, pool in ipairs(self.__pools) do
if pool:has(e) then
@ -119,8 +119,8 @@ function System:__remove(e)
return self
end
--- Internal: Clears all Entities from the System.
-- @return self
-- Internal: Clears all Entities from the System.
-- @treturn System self
function System:__clear()
for i = 1, #self.__pools do
self.__pools[i]:__clear()
@ -130,7 +130,7 @@ function System:__clear()
end
--- Enables the System.
-- @return self
-- @treturn System self
function System:enable()
self:setEnabled(true)
@ -138,7 +138,7 @@ function System:enable()
end
--- Disables the System.
-- @return self
-- @treturn System self
function System:disable()
self:setEnabled(false)
@ -146,7 +146,7 @@ function System:disable()
end
--- Toggles if the System is enabled.
-- @return self
-- @treturn System self
function System:toggleEnabled()
self:setEnabled(not self.__enabled)
@ -154,8 +154,8 @@ function System:toggleEnabled()
end
--- Sets if the System is enabled
-- @param enable Enable
-- @return self
-- @tparam boolean enable
-- @treturn System self
function System:setEnabled(enable)
if (not self.__enabled and enable) then
self.__enabled = true
@ -169,39 +169,42 @@ function System:setEnabled(enable)
end
--- Returns is the System is enabled
-- @return True if the System is enabled, false otherwise
-- @treturn boolean
function System:isEnabled()
return self.__enabled
end
--- Returns the World the System is in.
-- @return The World the System is in
-- @treturn World
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
-- @treturn boolean
function System:hasName()
return self.__name and true or false
end
--- Returns the name of the System.
-- @return Name of the System
-- @treturn string
function System:getName()
return self.__name
end
--- Callbacks
-- @section Callbacks
--- Callback for system initialization.
-- @param world The World the System was added to
-- @tparam World world The World the System was added to
function System:init(world) -- luacheck: ignore
end
-- Callback for when a System is enabled.
--- Callback for when a System is enabled.
function System:onEnabled() -- luacheck: ignore
end
-- Callback for when a System is disabled.
--- Callback for when a System is disabled.
function System:onDisabled() -- luacheck: ignore
end
@ -209,4 +212,4 @@ return setmetatable(System, {
__call = function(_, ...)
return System.new(...)
end,
})
})

View file

@ -1,5 +1,5 @@
--- Systems
-- Container for registered SystemClasses
--- Container for registered SystemClasses
-- @module Systems
local PATH = (...):gsub('%.[^%.]+$', '')
@ -8,8 +8,8 @@ local Type = require(PATH..".type")
local Systems = {}
--- Registers a SystemClass.
-- @param name Name to register under
-- @param systemClass SystemClass to register
-- @tparam string name Name to register under
-- @tparam System systemClass SystemClass to register
function Systems.register(name, systemClass)
if (type(name) ~= "string") then
error("bad argument #1 to 'Systems.register' (string expected, got "..type(name)..")", 3)
@ -28,14 +28,14 @@ function Systems.register(name, systemClass)
end
--- Returns true if the containter has the SystemClass with the name
-- @param name Name of the SystemClass to check
-- @return True if the containter has the SystemClass with the name, false otherwise
-- @tparam string name Name of the SystemClass to check
-- @treturn boolean
function Systems.has(name)
return Systems[name] and true or false
end
--- Returns the SystemClass with the name
-- @param name Name of the SystemClass to get
-- @tparam string name Name of the SystemClass to get
-- @return SystemClass with the name
function Systems.get(name)
return Systems[name]
@ -45,4 +45,4 @@ return setmetatable(Systems, {
__index = function(_, name)
error("Attempt to index system '"..tostring(name).."' that does not exist / was not registered", 2)
end
})
})

View file

@ -5,49 +5,49 @@ local Type = {}
--- Returns if object is an Entity.
-- @param t Object to check
-- @return True if object is an Entity, false otherwise
-- @treturn boolean
function Type.isEntity(t)
return type(t) == "table" and t.__isEntity or false
end
--- Returns if object is a ComponentClass.
-- @param t Object to check
-- @return True if object is an ComponentClass, false otherwise
-- @treturn boolean
function Type.isComponentClass(t)
return type(t) == "table" and t.__isComponentClass or false
end
--- Returns if object is a Component.
-- @param t Object to check
-- @return True if object is an Component, false otherwise
-- @treturn boolean
function Type.isComponent(t)
return type(t) == "table" and t.__isComponent or false
end
--- Returns if object is a SystemClass.
-- @param t Object to check
-- @return True if object is an SystemClass, false otherwise
-- @treturn boolean
function Type.isSystemClass(t)
return type(t) == "table" and t.__isSystemClass or false
end
--- Returns if object is a System.
-- @param t Object to check
-- @return True if object is an System, false otherwise
-- @treturn boolean
function Type.isSystem(t)
return type(t) == "table" and t.__isSystem or false
end
--- Returns if object is a World.
-- @param t Object to check
-- @return True if object is an World, false otherwise
-- @treturn boolean
function Type.isWorld(t)
return type(t) == "table" and t.__isWorld or false
end
--- Returns if object is an Assemblage.
-- @param t Object to check
-- @return True if object is an Assemblage, false otherwise
-- @treturn boolean
function Type.isAssemblage(t)
return type(t) == "table" and t.__isAssemblage or false
end

View file

@ -1,8 +1,8 @@
--- World
-- A World is 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
--- 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.
-- @classmod World
local PATH = (...):gsub('%.[^%.]+$', '')
@ -19,7 +19,7 @@ World.__mt = {
}
--- Creates a new World.
-- @return The new World
-- @treturn World The new World
function World.new()
local world = setmetatable({
__entities = List(),
@ -48,8 +48,8 @@ function World.new()
end
--- Adds an Entity to the World.
-- @param e Entity to add
-- @return self
-- @tparam Entity e Entity to add
-- @treturn World self
function World:addEntity(e)
if not Type.isEntity(e) then
error("bad argument #1 to 'World:addEntity' (Entity expected, got "..type(e)..")", 2)
@ -66,8 +66,8 @@ function World:addEntity(e)
end
--- Removes an Entity from the World.
-- @param e Entity to remove
-- @return self
-- @tparam Entity e Entity to remove
-- @treturn World self
function World:removeEntity(e)
if not Type.isEntity(e) then
error("bad argument #1 to 'World:removeEntity' (Entity expected, got "..type(e)..")", 2)
@ -78,7 +78,7 @@ function World:removeEntity(e)
return self
end
--- Internal: Marks an Entity as dirty.
-- Internal: Marks an Entity as dirty.
-- @param e Entity to mark as dirty
function World:__dirtyEntity(e)
if not self.__dirty:has(e) then
@ -86,9 +86,9 @@ function World:__dirtyEntity(e)
end
end
--- Internal: Flushes all changes to Entities.
-- Internal: Flushes all changes to Entities.
-- This processes all entities. Adding and removing entities, as well as reevaluating dirty entities.
-- @return self
-- @treturn World self
function World:__flush()
-- Early out
if (self.__added.size == 0 and self.__removed.size == 0 and self.__dirty.size == 0) then
@ -155,8 +155,8 @@ local blacklistedSystemFunctions = {
-- Callbacks are registered automatically
-- Entities added before are added to the System retroactively
-- @see World:emit
-- @param systemClass SystemClass of System to add
-- @return self
-- @tparam System systemClass SystemClass of System to add
-- @treturn World self
function World:addSystem(systemClass)
if (not Type.isSystemClass(systemClass)) then
error("bad argument #1 to 'World:addSystems' (SystemClass expected, got "..type(systemClass)..")", 2)
@ -202,7 +202,7 @@ end
-- @see World:addSystem
-- @see World:emit
-- @param ... SystemClasses of Systems to add
-- @return self
-- @treturn World self
function World:addSystems(...)
for i = 1, select("#", ...) do
local systemClass = select(i, ...)
@ -214,8 +214,8 @@ function World:addSystems(...)
end
--- Returns if the World has a System.
-- @param systemClass SystemClass of System to check for
-- @return True if World has System, false otherwise
-- @tparam System systemClass SystemClass of System to check for
-- @treturn boolean
function World:hasSystem(systemClass)
if not Type.isSystemClass(systemClass) then
error("bad argument #1 to 'World:getSystem' (systemClass expected, got "..type(systemClass)..")", 2)
@ -225,8 +225,8 @@ function World:hasSystem(systemClass)
end
--- Gets a System from the World.
-- @param systemClass SystemClass of System to get
-- @return System to get
-- @tparam System systemClass SystemClass of System to get
-- @treturn System System to get
function World:getSystem(systemClass)
if not Type.isSystemClass(systemClass) then
error("bad argument #1 to 'World:getSystem' (systemClass expected, got "..type(systemClass)..")", 2)
@ -237,9 +237,9 @@ end
--- Emits a callback in the World.
-- Calls all functions with the functionName of added Systems
-- @param functionName Name of functions to call.
-- @string functionName Name of functions to call.
-- @param ... Parameters passed to System's functions
-- @return self
-- @treturn World self
function World:emit(functionName, ...)
if not functionName or type(functionName) ~= "string" then
error("bad argument #1 to 'World:emit' (String expected, got "..type(functionName)..")")
@ -263,7 +263,7 @@ function World:emit(functionName, ...)
end
--- Removes all entities from the World
-- @return self
-- @treturn World self
function World:clear()
for i = 1, self.__entities.size do
self:removeEntity(self.__entities[i])
@ -318,24 +318,24 @@ function World:deserialize(data, append)
end
--- Returns true if the World has a name.
-- @return True if the World has a name, false otherwise
-- @treturn boolean
function World:hasName()
return self.__name and true or false
end
--- Returns the name of the World.
-- @return Name of the World
-- @treturn string
function World:getName()
return self.__name
end
--- Callback for when an Entity is added to the World.
-- @param e The Entity that was added
-- @tparam Entity e The Entity that was added
function World:onEntityAdded(e) -- luacheck: ignore
end
--- Callback for when an Entity is removed from the World.
-- @param e The Entity that was removed
-- @tparam Entity e The Entity that was removed
function World:onEntityRemoved(e) -- luacheck: ignore
end

View file

@ -8,7 +8,7 @@ local Type = require(PATH..".type")
local Worlds = {}
--- Registers a World.
-- @param name Name to register under
-- @tparam string name Name to register under
-- @param world World to register
function Worlds.register(name, world)
if (type(name) ~= "string") then
@ -28,14 +28,14 @@ function Worlds.register(name, world)
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
-- @tparam string name Name of the World to check
-- @treturn boolean
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
-- @tparam string name Name of the World to get
-- @return World with the name
function Worlds.get(name)
return Worlds[name]
@ -45,4 +45,4 @@ return setmetatable(Worlds, {
__index = function(_, name)
error("Attempt to index world '"..tostring(name).."' that does not exist / was not registered", 2)
end
})
})

View file

@ -1,3 +1,4 @@
project = 'Concord'
description = 'A feature-complete ECS library'
file = {'concord', exclude = {}}
file = {'concord', exclude = {}}
dir = 'docs'

View file

@ -0,0 +1,204 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Concord</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Methods">Methods</a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><strong>Assemblage</strong></li>
<li><a href="../classes/Component.html">Component</a></li>
<li><a href="../classes/Entity.html">Entity</a></li>
<li><a href="../classes/List.html">List</a></li>
<li><a href="../classes/Pool.html">Pool</a></li>
<li><a href="../classes/System.html">System</a></li>
<li><a href="../classes/World.html">World</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/Assemblages.html">Assemblages</a></li>
<li><a href="../modules/Components.html">Components</a></li>
<li><a href="../modules/Concord.html">Concord</a></li>
<li><a href="../modules/Systems.html">Systems</a></li>
<li><a href="../modules/type.html">type</a></li>
<li><a href="../modules/utils.html">utils</a></li>
<li><a href="../modules/worlds.html">worlds</a></li>
</ul>
</div>
<div id="content">
<h1>Class <code>Assemblage</code></h1>
<p>Gives an entity a set of components.</p>
<p></p>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Assemblage:new">Assemblage:new (assemble)</a></td>
<td class="summary">Creates a new Assemblage.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Assemblage:assemble">Assemblage:assemble (e, ...)</a></td>
<td class="summary">Assembles an Entity.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Assemblage:hasName">Assemblage:hasName ()</a></td>
<td class="summary">Returns true if the Assemblage has a name.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Assemblage:getName">Assemblage:getName ()</a></td>
<td class="summary">Returns the name of the Assemblage.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "Assemblage:new"></a>
<strong>Assemblage:new (assemble)</strong>
</dt>
<dd>
Creates a new Assemblage.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">assemble</span>
<span class="types"><span class="type">function</span></span>
Function that assembles an Entity
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/Assemblage.html#">Assemblage</a></span>
A new assemblage
</ol>
</dd>
<dt>
<a name = "Assemblage:assemble"></a>
<strong>Assemblage:assemble (e, ...)</strong>
</dt>
<dd>
Assembles an Entity.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">e</span>
<span class="types"><a class="type" href="../classes/Entity.html#">Entity</a></span>
Entity to assemble
</li>
<li><span class="parameter">...</span>
additional arguments to pass to the assemble function
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/Assemblage.html#">Assemblage</a></span>
self
</ol>
</dd>
<dt>
<a name = "Assemblage:hasName"></a>
<strong>Assemblage:hasName ()</strong>
</dt>
<dd>
Returns true if the Assemblage has a name.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
</ol>
</dd>
<dt>
<a name = "Assemblage:getName"></a>
<strong>Assemblage:getName ()</strong>
</dt>
<dd>
Returns the name of the Assemblage.
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
</ol>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 10:27:07 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

170
docs/classes/Component.html Normal file
View file

@ -0,0 +1,170 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Concord</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Methods">Methods</a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="../classes/Assemblage.html">Assemblage</a></li>
<li><strong>Component</strong></li>
<li><a href="../classes/Entity.html">Entity</a></li>
<li><a href="../classes/List.html">List</a></li>
<li><a href="../classes/Pool.html">Pool</a></li>
<li><a href="../classes/System.html">System</a></li>
<li><a href="../classes/World.html">World</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/Assemblages.html">Assemblages</a></li>
<li><a href="../modules/Components.html">Components</a></li>
<li><a href="../modules/Concord.html">Concord</a></li>
<li><a href="../modules/Systems.html">Systems</a></li>
<li><a href="../modules/type.html">type</a></li>
<li><a href="../modules/utils.html">utils</a></li>
<li><a href="../modules/worlds.html">worlds</a></li>
</ul>
</div>
<div id="content">
<h1>Class <code>Component</code></h1>
<p>A pure data container that is contained by a single entity.</p>
<p></p>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Component:new">Component:new (populate)</a></td>
<td class="summary">Creates a new ComponentClass.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Component:hasName">Component:hasName ()</a></td>
<td class="summary">Returns true if the Component has a name.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Component:getName">Component:getName ()</a></td>
<td class="summary">Returns the name of the Component.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "Component:new"></a>
<strong>Component:new (populate)</strong>
</dt>
<dd>
Creates a new ComponentClass.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">populate</span>
<span class="types"><span class="type">function</span></span>
Function that populates a Component with values
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/Component.html#">Component</a></span>
A new ComponentClass
</ol>
</dd>
<dt>
<a name = "Component:hasName"></a>
<strong>Component:hasName ()</strong>
</dt>
<dd>
Returns true if the Component has a name.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
</ol>
</dd>
<dt>
<a name = "Component:getName"></a>
<strong>Component:getName ()</strong>
</dt>
<dd>
Returns the name of the Component.
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
</ol>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 10:27:07 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View file

@ -32,25 +32,28 @@
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Methods">Methods</a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="../classes/Assemblage.html">Assemblage</a></li>
<li><a href="../classes/Component.html">Component</a></li>
<li><strong>Entity</strong></li>
<li><a href="../classes/List.html">List</a></li>
<li><a href="../classes/Pool.html">Pool</a></li>
<li><a href="../classes/System.html">System</a></li>
<li><a href="../classes/World.html">World</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/assemblage.html">assemblage</a></li>
<li><a href="../modules/assemblages.html">assemblages</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/components.html">components</a></li>
<li><strong>entity</strong></li>
<li><a href="../modules/init.html">init</a></li>
<li><a href="../modules/list.html">list</a></li>
<li><a href="../modules/pool.html">pool</a></li>
<li><a href="../modules/system.html">system</a></li>
<li><a href="../modules/systems.html">systems</a></li>
<li><a href="../modules/Assemblages.html">Assemblages</a></li>
<li><a href="../modules/Components.html">Components</a></li>
<li><a href="../modules/Concord.html">Concord</a></li>
<li><a href="../modules/Systems.html">Systems</a></li>
<li><a href="../modules/type.html">type</a></li>
<li><a href="../modules/utils.html">utils</a></li>
<li><a href="../modules/world.html">world</a></li>
<li><a href="../modules/worlds.html">worlds</a></li>
</ul>
@ -58,18 +61,17 @@
<div id="content">
<h1>Module <code>entity</code></h1>
<p>Entity
Entities are the concrete objects that exist in your project.</p>
<p>
An Entity have Components and are processed by Systems.
An Entity is contained by a maximum of 1 World.</p>
<h1>Class <code>Entity</code></h1>
<p>An object that exists in a world.</p>
<p> An entity
contains components which are processed by systems.
</p>
<h2><a href="#Functions">Functions</a></h2>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Entity.new">Entity.new (world)</a></td>
<td class="name" nowrap><a href="#Entity:new">Entity:new ([world])</a></td>
<td class="summary">Creates a new Entity.</td>
</tr>
<tr>
@ -93,10 +95,6 @@
<td class="summary">Destroys the Entity.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Entity:__dirty">Entity:__dirty ()</a></td>
<td class="summary">Internal: Tells the World it's in that this Entity is dirty.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Entity:has">Entity:has (componentClass)</a></td>
<td class="summary">Returns true if the Entity has a Component.</td>
</tr>
@ -122,12 +120,12 @@
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<h2 class="section-header "><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "Entity.new"></a>
<strong>Entity.new (world)</strong>
<a name = "Entity:new"></a>
<strong>Entity:new ([world])</strong>
</dt>
<dd>
Creates a new Entity. Optionally adds it to a World.
@ -136,13 +134,16 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">world</span>
Optional World to add the entity to
<span class="types"><a class="type" href="../classes/World.html#">World</a></span>
World to add the entity to
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/Entity.html#">Entity</a></span>
A new Entity
</ol>
@ -162,16 +163,18 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">componentClass</span>
<span class="types"><a class="type" href="../classes/Component.html#">Component</a></span>
ComponentClass to add an instance of
</li>
<li><span class="parameter">...</span>
varargs passed to the Component's populate function
additional arguments to pass to the Component's populate function
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/Entity.html#">Entity</a></span>
self
</ol>
@ -191,16 +194,18 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">componentClass</span>
<span class="types"><a class="type" href="../classes/Component.html#">Component</a></span>
ComponentClass to add an instance of
</li>
<li><span class="parameter">...</span>
varargs passed to the Component's populate function
additional arguments to pass to the Component's populate function
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/Entity.html#">Entity</a></span>
self
</ol>
@ -219,6 +224,7 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">componentClass</span>
<span class="types"><a class="type" href="../classes/Component.html#">Component</a></span>
ComponentClass of the Component to remove
</li>
</ul>
@ -226,6 +232,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/Entity.html#">Entity</a></span>
self
</ol>
@ -244,13 +251,20 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">assemblage</span>
<span class="types"><a class="type" href="../classes/Assemblage.html#">Assemblage</a></span>
Assemblage to assemble with
</li>
<li><span class="parameter">...</span>
Varargs to pass to the Assemblage's assemble function.
additional arguments to pass to the Assemblage's assemble function.
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/Entity.html#">Entity</a></span>
self
</ol>
@ -262,26 +276,7 @@
</dt>
<dd>
Destroys the Entity.
Removes the Entity from it's World if it's in one.
<h3>Returns:</h3>
<ol>
self
</ol>
</dd>
<dt>
<a name = "Entity:__dirty"></a>
<strong>Entity:__dirty ()</strong>
</dt>
<dd>
Internal: Tells the World it's in that this Entity is dirty.
Removes the Entity from its World if it's in one.
@ -306,6 +301,7 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">componentClass</span>
<span class="types"><a class="type" href="../classes/Component.html#">Component</a></span>
ComponentClass of the Component to check
</li>
</ul>
@ -313,7 +309,8 @@
<h3>Returns:</h3>
<ol>
True if the Entity has the Component, false otherwise
<span class="types"><span class="type">boolean</span></span>
</ol>
@ -331,6 +328,7 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">componentClass</span>
<span class="types"><a class="type" href="../classes/Component.html#">Component</a></span>
ComponentClass of the Component to get
</li>
</ul>
@ -338,7 +336,8 @@
<h3>Returns:</h3>
<ol>
The Component
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
</ol>
@ -359,6 +358,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
Table of all Components the Entity has
</ol>
@ -378,7 +378,8 @@
<h3>Returns:</h3>
<ol>
True if the Entity is in a World, false otherwise
<span class="types"><span class="type">boolean</span></span>
</ol>
@ -397,7 +398,8 @@
<h3>Returns:</h3>
<ol>
The World the Entity is in.
<span class="types"><a class="type" href="../classes/World.html#">World</a></span>
</ol>
@ -411,7 +413,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 00:43:06 </i>
<i style="float:right;">Last updated 2020-01-04 10:27:07 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View file

@ -32,25 +32,29 @@
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Methods">Methods</a></li>
<li><a href="#Metamethods">Metamethods</a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="../classes/Assemblage.html">Assemblage</a></li>
<li><a href="../classes/Component.html">Component</a></li>
<li><a href="../classes/Entity.html">Entity</a></li>
<li><strong>List</strong></li>
<li><a href="../classes/Pool.html">Pool</a></li>
<li><a href="../classes/System.html">System</a></li>
<li><a href="../classes/World.html">World</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/assemblage.html">assemblage</a></li>
<li><a href="../modules/assemblages.html">assemblages</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/components.html">components</a></li>
<li><a href="../modules/entity.html">entity</a></li>
<li><a href="../modules/init.html">init</a></li>
<li><strong>list</strong></li>
<li><a href="../modules/pool.html">pool</a></li>
<li><a href="../modules/system.html">system</a></li>
<li><a href="../modules/systems.html">systems</a></li>
<li><a href="../modules/Assemblages.html">Assemblages</a></li>
<li><a href="../modules/Components.html">Components</a></li>
<li><a href="../modules/Concord.html">Concord</a></li>
<li><a href="../modules/Systems.html">Systems</a></li>
<li><a href="../modules/type.html">type</a></li>
<li><a href="../modules/utils.html">utils</a></li>
<li><a href="../modules/world.html">world</a></li>
<li><a href="../modules/worlds.html">worlds</a></li>
</ul>
@ -58,31 +62,18 @@
<div id="content">
<h1>Module <code>list</code></h1>
<p>List
Data structure that allows for fast removal at the cost of containing order.</p>
<h1>Class <code>List</code></h1>
<p>Data structure that allows for fast removal at the cost of containing order.</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#List.new">List.new ()</a></td>
<td class="name" nowrap><a href="#List:new">List:new ()</a></td>
<td class="summary">Creates a new List.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#List:__add">List:__add (obj)</a></td>
<td class="summary">Adds an object to the List.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#List:__remove">List:__remove (obj)</a></td>
<td class="summary">Removes an object from the List.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#List:__clear">List:__clear ()</a></td>
<td class="summary">Clears the List completely.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#List:has">List:has (obj)</a></td>
<td class="summary">Returns true if the List has the object.</td>
</tr>
@ -95,17 +86,32 @@
<td class="summary">Returns the index of an object in the List.</td>
</tr>
</table>
<h2><a href="#Metamethods">Metamethods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#List:__add">List:__add (obj)</a></td>
<td class="summary">Adds an object to the List.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#List:__remove">List:__remove (obj)</a></td>
<td class="summary">Removes an object from the List.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#List:__clear">List:__clear ()</a></td>
<td class="summary">Clears the List completely.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<h2 class="section-header "><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "List.new"></a>
<strong>List.new ()</strong>
<a name = "List:new"></a>
<strong>List:new ()</strong>
</dt>
<dd>
Creates a new List.
@ -115,83 +121,13 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/List.html#">List</a></span>
A new List
</ol>
</dd>
<dt>
<a name = "List:__add"></a>
<strong>List:__add (obj)</strong>
</dt>
<dd>
Adds an object to the List.
Object must be of reference type
Object may not be the string 'size'
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">obj</span>
Object to add
</li>
</ul>
<h3>Returns:</h3>
<ol>
self
</ol>
</dd>
<dt>
<a name = "List:__remove"></a>
<strong>List:__remove (obj)</strong>
</dt>
<dd>
Removes an object from the List.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">obj</span>
Object to remove
</li>
</ul>
<h3>Returns:</h3>
<ol>
self
</ol>
</dd>
<dt>
<a name = "List:__clear"></a>
<strong>List:__clear ()</strong>
</dt>
<dd>
Clears the List completely.
<h3>Returns:</h3>
<ol>
self
</ol>
</dd>
<dt>
<a name = "List:has"></a>
@ -211,7 +147,8 @@
<h3>Returns:</h3>
<ol>
True if the List has the object, false otherwise
<span class="types"><span class="type">boolean</span></span>
</ol>
@ -229,6 +166,7 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">i</span>
<span class="types"><span class="type">number</span></span>
Index to get from
</li>
</ul>
@ -261,12 +199,91 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">number</span></span>
index of object in the List.
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Metamethods"></a>Metamethods</h2>
<dl class="function">
<dt>
<a name = "List:__add"></a>
<strong>List:__add (obj)</strong>
</dt>
<dd>
Adds an object to the List.
Object must be of reference type
Object may not be the string 'size'
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">obj</span>
Object to add
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/List.html#">List</a></span>
self
</ol>
</dd>
<dt>
<a name = "List:__remove"></a>
<strong>List:__remove (obj)</strong>
</dt>
<dd>
Removes an object from the List.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">obj</span>
Object to remove
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/List.html#">List</a></span>
self
</ol>
</dd>
<dt>
<a name = "List:__clear"></a>
<strong>List:__clear ()</strong>
</dt>
<dd>
Clears the List completely.
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/List.html#">List</a></span>
self
</ol>
</dd>
</dl>
@ -275,7 +292,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 00:43:06 </i>
<i style="float:right;">Last updated 2020-01-04 10:27:07 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View file

@ -32,25 +32,29 @@
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Methods">Methods</a></li>
<li><a href="#Metamethods">Metamethods</a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="../classes/Assemblage.html">Assemblage</a></li>
<li><a href="../classes/Component.html">Component</a></li>
<li><a href="../classes/Entity.html">Entity</a></li>
<li><a href="../classes/List.html">List</a></li>
<li><strong>Pool</strong></li>
<li><a href="../classes/System.html">System</a></li>
<li><a href="../classes/World.html">World</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/assemblage.html">assemblage</a></li>
<li><a href="../modules/assemblages.html">assemblages</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/components.html">components</a></li>
<li><a href="../modules/entity.html">entity</a></li>
<li><a href="../modules/init.html">init</a></li>
<li><a href="../modules/list.html">list</a></li>
<li><strong>pool</strong></li>
<li><a href="../modules/system.html">system</a></li>
<li><a href="../modules/systems.html">systems</a></li>
<li><a href="../modules/Assemblages.html">Assemblages</a></li>
<li><a href="../modules/Components.html">Components</a></li>
<li><a href="../modules/Concord.html">Concord</a></li>
<li><a href="../modules/Systems.html">Systems</a></li>
<li><a href="../modules/type.html">type</a></li>
<li><a href="../modules/utils.html">utils</a></li>
<li><a href="../modules/world.html">world</a></li>
<li><a href="../modules/worlds.html">worlds</a></li>
</ul>
@ -58,32 +62,19 @@
<div id="content">
<h1>Module <code>pool</code></h1>
<p>Pool
A Pool is used to iterate over Entities with a specific Components
<h1>Class <code>Pool</code></h1>
<p>Used to iterate over Entities with a specific Components
A Pool contain a any amount of Entities.</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Pool.new">Pool.new (name, filter)</a></td>
<td class="name" nowrap><a href="#Pool:new">Pool:new (name, filter)</a></td>
<td class="summary">Creates a new Pool</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Pool:__eligible">Pool:__eligible (e)</a></td>
<td class="summary">Checks if an Entity is eligible for the Pool.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Pool:__add">Pool:__add (e)</a></td>
<td class="summary">Internal: Adds an Entity to the Pool.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Pool:__remove">Pool:__remove (e)</a></td>
<td class="summary">Internal: Removed an Entity from the Pool.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Pool:getName">Pool:getName ()</a></td>
<td class="summary">Gets the name of the Pool</td>
</tr>
@ -96,17 +87,24 @@
<td class="summary">Callback for when an Entity is added to the Pool.</td>
</tr>
</table>
<h2><a href="#Metamethods">Metamethods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Pool:__eligible">Pool:__eligible (e)</a></td>
<td class="summary">Checks if an Entity is eligible for the Pool.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<h2 class="section-header "><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "Pool.new"></a>
<strong>Pool.new (name, filter)</strong>
<a name = "Pool:new"></a>
<strong>Pool:new (name, filter)</strong>
</dt>
<dd>
Creates a new Pool
@ -115,9 +113,11 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Name for the Pool.
</li>
<li><span class="parameter">filter</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
Table containing the required BaseComponents
</li>
</ul>
@ -125,87 +125,13 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/Pool.html#">Pool</a></span>
The new Pool
</ol>
</dd>
<dt>
<a name = "Pool:__eligible"></a>
<strong>Pool:__eligible (e)</strong>
</dt>
<dd>
Checks if an Entity is eligible for the Pool.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">e</span>
Entity to check
</li>
</ul>
<h3>Returns:</h3>
<ol>
True if the entity is eligible, false otherwise
</ol>
</dd>
<dt>
<a name = "Pool:__add"></a>
<strong>Pool:__add (e)</strong>
</dt>
<dd>
Internal: Adds an Entity to the Pool.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">e</span>
Entity to add
</li>
</ul>
<h3>Returns:</h3>
<ol>
self
</ol>
</dd>
<dt>
<a name = "Pool:__remove"></a>
<strong>Pool:__remove (e)</strong>
</dt>
<dd>
Internal: Removed an Entity from the Pool.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">e</span>
Entity to remove
</li>
</ul>
<h3>Returns:</h3>
<ol>
self
</ol>
</dd>
<dt>
<a name = "Pool:getName"></a>
@ -219,7 +145,8 @@
<h3>Returns:</h3>
<ol>
Name of the Pool.
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
</ol>
@ -257,6 +184,7 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">e</span>
<span class="types"><a class="type" href="../classes/Entity.html#">Entity</a></span>
Entity that was added.
</li>
</ul>
@ -265,6 +193,37 @@
</dd>
</dl>
<h2 class="section-header "><a name="Metamethods"></a>Metamethods</h2>
<dl class="function">
<dt>
<a name = "Pool:__eligible"></a>
<strong>Pool:__eligible (e)</strong>
</dt>
<dd>
Checks if an Entity is eligible for the Pool.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">e</span>
<span class="types"><a class="type" href="../classes/Entity.html#">Entity</a></span>
Entity to check
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
</ol>
</dd>
</dl>
@ -273,7 +232,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 00:43:06 </i>
<i style="float:right;">Last updated 2020-01-04 10:27:07 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View file

@ -32,25 +32,29 @@
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Methods">Methods</a></li>
<li><a href="#Callbacks">Callbacks </a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="../classes/Assemblage.html">Assemblage</a></li>
<li><a href="../classes/Component.html">Component</a></li>
<li><a href="../classes/Entity.html">Entity</a></li>
<li><a href="../classes/List.html">List</a></li>
<li><a href="../classes/Pool.html">Pool</a></li>
<li><strong>System</strong></li>
<li><a href="../classes/World.html">World</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/assemblage.html">assemblage</a></li>
<li><a href="../modules/assemblages.html">assemblages</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/components.html">components</a></li>
<li><a href="../modules/entity.html">entity</a></li>
<li><a href="../modules/init.html">init</a></li>
<li><a href="../modules/list.html">list</a></li>
<li><a href="../modules/pool.html">pool</a></li>
<li><strong>system</strong></li>
<li><a href="../modules/systems.html">systems</a></li>
<li><a href="../modules/Assemblages.html">Assemblages</a></li>
<li><a href="../modules/Components.html">Components</a></li>
<li><a href="../modules/Concord.html">Concord</a></li>
<li><a href="../modules/Systems.html">Systems</a></li>
<li><a href="../modules/type.html">type</a></li>
<li><a href="../modules/utils.html">utils</a></li>
<li><a href="../modules/world.html">world</a></li>
<li><a href="../modules/worlds.html">worlds</a></li>
</ul>
@ -58,37 +62,21 @@
<div id="content">
<h1>Module <code>system</code></h1>
<p>System
A System iterates over Entities.</p>
<h1>Class <code>System</code></h1>
<p>Iterates over Entities.</p>
<p> From these Entities its get Components and modify them.
A System contains 1 or more Pools.
A System is contained by 1 World.</p>
A System is contained by 1 World.
</p>
<h2><a href="#Functions">Functions</a></h2>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#System.new">System.new (...)</a></td>
<td class="name" nowrap><a href="#System:new">System:new (...)</a></td>
<td class="summary">Creates a new SystemClass.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#System.__buildPool">System.__buildPool (baseFilter)</a></td>
<td class="summary">Internal: Builds a Pool for the System.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#System:__evaluate">System:__evaluate (e)</a></td>
<td class="summary">Internal: Evaluates an Entity for all the System's Pools.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#System:__remove">System:__remove (e)</a></td>
<td class="summary">Internal: Removes an Entity from the System.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#System:clear">System:clear ()</a></td>
<td class="summary">Internal: Clears all Entities from the System.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#System:enable">System:enable ()</a></td>
<td class="summary">Enables the System.</td>
</tr>
@ -97,7 +85,7 @@
<td class="summary">Disables the System.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#System:toggleEnable">System:toggleEnable ()</a></td>
<td class="name" nowrap><a href="#System:toggleEnabled">System:toggleEnabled ()</a></td>
<td class="summary">Toggles if the System is enabled.</td>
</tr>
<tr>
@ -112,22 +100,41 @@
<td class="name" nowrap><a href="#System:getWorld">System:getWorld ()</a></td>
<td class="summary">Returns the World the System is in.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#System:hasName">System:hasName ()</a></td>
<td class="summary">Returns true if the System has a name.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#System:getName">System:getName ()</a></td>
<td class="summary">Returns the name of the System.</td>
</tr>
</table>
<h2><a href="#Callbacks">Callbacks </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#System:init">System:init (world)</a></td>
<td class="summary">Callback for system initialization.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#System:onEnabled">System:onEnabled ()</a></td>
<td class="summary">Callback for when a System is enabled.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#System:onDisabled">System:onDisabled ()</a></td>
<td class="summary">Callback for when a System is disabled.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<h2 class="section-header "><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "System.new"></a>
<strong>System.new (...)</strong>
<a name = "System:new"></a>
<strong>System:new (...)</strong>
</dt>
<dd>
Creates a new SystemClass.
@ -143,106 +150,13 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/System.html#">System</a></span>
A new SystemClass
</ol>
</dd>
<dt>
<a name = "System.__buildPool"></a>
<strong>System.__buildPool (baseFilter)</strong>
</dt>
<dd>
Internal: Builds a Pool for the System.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">baseFilter</span>
The 'raw' Filter
</li>
</ul>
<h3>Returns:</h3>
<ol>
A new Pool
</ol>
</dd>
<dt>
<a name = "System:__evaluate"></a>
<strong>System:__evaluate (e)</strong>
</dt>
<dd>
Internal: Evaluates an Entity for all the System's Pools.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">e</span>
The Entity to check
</li>
</ul>
<h3>Returns:</h3>
<ol>
self
</ol>
</dd>
<dt>
<a name = "System:__remove"></a>
<strong>System:__remove (e)</strong>
</dt>
<dd>
Internal: Removes an Entity from the System.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">e</span>
The Entity to remove
</li>
</ul>
<h3>Returns:</h3>
<ol>
self
</ol>
</dd>
<dt>
<a name = "System:clear"></a>
<strong>System:clear ()</strong>
</dt>
<dd>
Internal: Clears all Entities from the System.
<h3>Returns:</h3>
<ol>
self
</ol>
</dd>
<dt>
<a name = "System:enable"></a>
@ -256,6 +170,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/System.html#">System</a></span>
self
</ol>
@ -275,6 +190,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/System.html#">System</a></span>
self
</ol>
@ -283,8 +199,8 @@
</dd>
<dt>
<a name = "System:toggleEnable"></a>
<strong>System:toggleEnable ()</strong>
<a name = "System:toggleEnabled"></a>
<strong>System:toggleEnabled ()</strong>
</dt>
<dd>
Toggles if the System is enabled.
@ -294,6 +210,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/System.html#">System</a></span>
self
</ol>
@ -312,13 +229,15 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">enable</span>
Enable
<span class="types"><span class="type">boolean</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/System.html#">System</a></span>
self
</ol>
@ -338,7 +257,8 @@
<h3>Returns:</h3>
<ol>
True if the System is enabled, false otherwise
<span class="types"><span class="type">boolean</span></span>
</ol>
@ -357,13 +277,58 @@
<h3>Returns:</h3>
<ol>
The World the System is in
<span class="types"><a class="type" href="../classes/World.html#">World</a></span>
</ol>
</dd>
<dt>
<a name = "System:hasName"></a>
<strong>System:hasName ()</strong>
</dt>
<dd>
Returns true if the System has a name.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
</ol>
</dd>
<dt>
<a name = "System:getName"></a>
<strong>System:getName ()</strong>
</dt>
<dd>
Returns the name of the System.
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Callbacks"></a>Callbacks </h2>
<dl class="function">
<dt>
<a name = "System:init"></a>
<strong>System:init (world)</strong>
@ -375,6 +340,7 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">world</span>
<span class="types"><a class="type" href="../classes/World.html#">World</a></span>
The World the System was added to
</li>
</ul>
@ -383,6 +349,34 @@
</dd>
<dt>
<a name = "System:onEnabled"></a>
<strong>System:onEnabled ()</strong>
</dt>
<dd>
Callback for when a System is enabled.
</dd>
<dt>
<a name = "System:onDisabled"></a>
<strong>System:onDisabled ()</strong>
</dt>
<dd>
Callback for when a System is disabled.
</dd>
</dl>
@ -391,7 +385,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 00:43:06 </i>
<i style="float:right;">Last updated 2020-01-04 10:27:07 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View file

@ -32,25 +32,28 @@
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Methods">Methods</a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="../classes/Assemblage.html">Assemblage</a></li>
<li><a href="../classes/Component.html">Component</a></li>
<li><a href="../classes/Entity.html">Entity</a></li>
<li><a href="../classes/List.html">List</a></li>
<li><a href="../classes/Pool.html">Pool</a></li>
<li><a href="../classes/System.html">System</a></li>
<li><strong>World</strong></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/assemblage.html">assemblage</a></li>
<li><a href="../modules/assemblages.html">assemblages</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/components.html">components</a></li>
<li><a href="../modules/entity.html">entity</a></li>
<li><a href="../modules/init.html">init</a></li>
<li><a href="../modules/list.html">list</a></li>
<li><a href="../modules/pool.html">pool</a></li>
<li><a href="../modules/system.html">system</a></li>
<li><a href="../modules/systems.html">systems</a></li>
<li><a href="../modules/Assemblages.html">Assemblages</a></li>
<li><a href="../modules/Components.html">Components</a></li>
<li><a href="../modules/Concord.html">Concord</a></li>
<li><a href="../modules/Systems.html">Systems</a></li>
<li><a href="../modules/type.html">type</a></li>
<li><a href="../modules/utils.html">utils</a></li>
<li><strong>world</strong></li>
<li><a href="../modules/worlds.html">worlds</a></li>
</ul>
@ -58,19 +61,19 @@
<div id="content">
<h1>Module <code>world</code></h1>
<p>World
A World is 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</p>
<p></p>
<h1>Class <code>World</code></h1>
<p>A collection of Systems and Entities.</p>
<p>
A world emits to let Systems iterate.
A World contains any amount of Systems.
A World contains any amount of Entities.
</p>
<h2><a href="#Functions">Functions</a></h2>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#World.new">World.new ()</a></td>
<td class="name" nowrap><a href="#World:new">World:new ()</a></td>
<td class="summary">Creates a new World.</td>
</tr>
<tr>
@ -82,14 +85,6 @@
<td class="summary">Removes an Entity from the World.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#World:__dirtyEntity">World:__dirtyEntity (e)</a></td>
<td class="summary">Internal: Marks an Entity as dirty.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#World:__flush">World:__flush ()</a></td>
<td class="summary">Internal: Flushes all changes to Entities.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#World:addSystem">World:addSystem (systemClass)</a></td>
<td class="summary">Adds a System to the World.</td>
</tr>
@ -114,6 +109,14 @@
<td class="summary">Removes all entities from the World</td>
</tr>
<tr>
<td class="name" nowrap><a href="#World:hasName">World:hasName ()</a></td>
<td class="summary">Returns true if the World has a name.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#World:getName">World:getName ()</a></td>
<td class="summary">Returns the name of the World.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#World:onEntityAdded">World:onEntityAdded (e)</a></td>
<td class="summary">Callback for when an Entity is added to the World.</td>
</tr>
@ -127,12 +130,12 @@
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<h2 class="section-header "><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "World.new"></a>
<strong>World.new ()</strong>
<a name = "World:new"></a>
<strong>World:new ()</strong>
</dt>
<dd>
Creates a new World.
@ -142,6 +145,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/World.html#">World</a></span>
The new World
</ol>
@ -160,6 +164,7 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">e</span>
<span class="types"><a class="type" href="../classes/Entity.html#">Entity</a></span>
Entity to add
</li>
</ul>
@ -167,6 +172,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/World.html#">World</a></span>
self
</ol>
@ -185,6 +191,7 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">e</span>
<span class="types"><a class="type" href="../classes/Entity.html#">Entity</a></span>
Entity to remove
</li>
</ul>
@ -192,46 +199,7 @@
<h3>Returns:</h3>
<ol>
self
</ol>
</dd>
<dt>
<a name = "World:__dirtyEntity"></a>
<strong>World:__dirtyEntity (e)</strong>
</dt>
<dd>
Internal: Marks an Entity as dirty.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">e</span>
Entity to mark as dirty
</li>
</ul>
</dd>
<dt>
<a name = "World:__flush"></a>
<strong>World:__flush ()</strong>
</dt>
<dd>
Internal: Flushes all changes to Entities.
This processes all entities. Adding and removing entities, as well as reevaluating dirty entities.
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/World.html#">World</a></span>
self
</ol>
@ -252,6 +220,7 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">systemClass</span>
<span class="types"><a class="type" href="../classes/System.html#">System</a></span>
SystemClass of System to add
</li>
</ul>
@ -259,13 +228,14 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/World.html#">World</a></span>
self
</ol>
<h3>See also:</h3>
<ul>
<a href="../modules/world.html#World:emit">World:emit</a>
<a href="../classes/World.html#World:emit">World:emit</a>
</ul>
@ -289,14 +259,15 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/World.html#">World</a></span>
self
</ol>
<h3>See also:</h3>
<ul>
<li><a href="../modules/world.html#World:addSystem">World:addSystem</a></li>
<li><a href="../modules/world.html#World:emit">World:emit</a></li>
<li><a href="../classes/World.html#World:addSystem">World:addSystem</a></li>
<li><a href="../classes/World.html#World:emit">World:emit</a></li>
</ul>
@ -312,6 +283,7 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">systemClass</span>
<span class="types"><a class="type" href="../classes/System.html#">System</a></span>
SystemClass of System to check for
</li>
</ul>
@ -319,7 +291,8 @@
<h3>Returns:</h3>
<ol>
True if World has System, false otherwise
<span class="types"><span class="type">boolean</span></span>
</ol>
@ -337,6 +310,7 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">systemClass</span>
<span class="types"><a class="type" href="../classes/System.html#">System</a></span>
SystemClass of System to get
</li>
</ul>
@ -344,6 +318,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/System.html#">System</a></span>
System to get
</ol>
@ -363,6 +338,7 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">functionName</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Name of functions to call.
</li>
<li><span class="parameter">...</span>
@ -373,6 +349,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/World.html#">World</a></span>
self
</ol>
@ -392,12 +369,53 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/World.html#">World</a></span>
self
</ol>
</dd>
<dt>
<a name = "World:hasName"></a>
<strong>World:hasName ()</strong>
</dt>
<dd>
Returns true if the World has a name.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
</ol>
</dd>
<dt>
<a name = "World:getName"></a>
<strong>World:getName ()</strong>
</dt>
<dd>
Returns the name of the World.
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
</ol>
</dd>
<dt>
<a name = "World:onEntityAdded"></a>
@ -410,6 +428,7 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">e</span>
<span class="types"><a class="type" href="../classes/Entity.html#">Entity</a></span>
The Entity that was added
</li>
</ul>
@ -430,6 +449,7 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">e</span>
<span class="types"><a class="type" href="../classes/Entity.html#">Entity</a></span>
The Entity that was removed
</li>
</ul>
@ -446,7 +466,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 00:43:06 </i>
<i style="float:right;">Last updated 2020-01-04 10:27:07 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View file

@ -31,21 +31,24 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="modules/assemblage.html">assemblage</a></li>
<li><a href="modules/assemblages.html">assemblages</a></li>
<li><a href="modules/component.html">component</a></li>
<li><a href="modules/components.html">components</a></li>
<li><a href="modules/entity.html">entity</a></li>
<li><a href="modules/init.html">init</a></li>
<li><a href="modules/list.html">list</a></li>
<li><a href="modules/pool.html">pool</a></li>
<li><a href="modules/system.html">system</a></li>
<li><a href="modules/systems.html">systems</a></li>
<li><a href="modules/Assemblages.html">Assemblages</a></li>
<li><a href="modules/Components.html">Components</a></li>
<li><a href="modules/Concord.html">Concord</a></li>
<li><a href="modules/Systems.html">Systems</a></li>
<li><a href="modules/type.html">type</a></li>
<li><a href="modules/utils.html">utils</a></li>
<li><a href="modules/world.html">world</a></li>
<li><a href="modules/worlds.html">worlds</a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="classes/Assemblage.html">Assemblage</a></li>
<li><a href="classes/Component.html">Component</a></li>
<li><a href="classes/Entity.html">Entity</a></li>
<li><a href="classes/List.html">List</a></li>
<li><a href="classes/Pool.html">Pool</a></li>
<li><a href="classes/System.html">System</a></li>
<li><a href="classes/World.html">World</a></li>
</ul>
</div>
@ -57,54 +60,20 @@
<h2>Modules</h2>
<table class="module_list">
<tr>
<td class="name" nowrap><a href="modules/assemblage.html">assemblage</a></td>
<td class="summary">Assemblage
An Assemblage is a function that 'makes' an entity something.</td>
<td class="name" nowrap><a href="modules/Assemblages.html">Assemblages</a></td>
<td class="summary">A container for registered <a href="classes/Assemblage.html#">Assemblage</a>s</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/assemblages.html">assemblages</a></td>
<td class="summary">Assemblages
Container for registered Assemblages</td>
<td class="name" nowrap><a href="modules/Components.html">Components</a></td>
<td class="summary">Container for registered ComponentClasses</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/component.html">component</a></td>
<td class="summary">Component
A Component is a pure data container.</td>
<td class="name" nowrap><a href="modules/Concord.html">Concord</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/components.html">components</a></td>
<td class="summary">Components
Container for registered ComponentClasss</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/entity.html">entity</a></td>
<td class="summary">Entity
Entities are the concrete objects that exist in your project.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/init.html">init</a></td>
<td class="summary">init</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/list.html">list</a></td>
<td class="summary">List
Data structure that allows for fast removal at the cost of containing order.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/pool.html">pool</a></td>
<td class="summary">Pool
A Pool is used to iterate over Entities with a specific Components
A Pool contain a any amount of Entities.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/system.html">system</a></td>
<td class="summary">System
A System iterates over Entities.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/systems.html">systems</a></td>
<td class="summary">Systems
Container for registered SystemClasses</td>
<td class="name" nowrap><a href="modules/Systems.html">Systems</a></td>
<td class="summary">Container for registered SystemClasses</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/type.html">type</a></td>
@ -115,14 +84,6 @@
<td class="name" nowrap><a href="modules/utils.html">utils</a></td>
<td class="summary">Utils
Helper module for misc operations</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/world.html">world</a></td>
<td class="summary">World
A World is 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</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/worlds.html">worlds</a></td>
@ -130,12 +91,44 @@
Container for registered Worlds</td>
</tr>
</table>
<h2>Classes</h2>
<table class="module_list">
<tr>
<td class="name" nowrap><a href="classes/Assemblage.html">Assemblage</a></td>
<td class="summary">Gives an entity a set of components.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/Component.html">Component</a></td>
<td class="summary">A pure data container that is contained by a single entity.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/Entity.html">Entity</a></td>
<td class="summary">An object that exists in a world.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/List.html">List</a></td>
<td class="summary">Data structure that allows for fast removal at the cost of containing order.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/Pool.html">Pool</a></td>
<td class="summary">Used to iterate over Entities with a specific Components
A Pool contain a any amount of Entities.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/System.html">System</a></td>
<td class="summary">Iterates over Entities.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/World.html">World</a></td>
<td class="summary">A collection of Systems and Entities.</td>
</tr>
</table>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 00:43:06 </i>
<i style="float:right;">Last updated 2020-01-04 10:27:07 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View file

@ -38,47 +38,50 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/assemblage.html">assemblage</a></li>
<li><a href="../modules/assemblages.html">assemblages</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/components.html">components</a></li>
<li><a href="../modules/entity.html">entity</a></li>
<li><strong>init</strong></li>
<li><a href="../modules/list.html">list</a></li>
<li><a href="../modules/pool.html">pool</a></li>
<li><a href="../modules/system.html">system</a></li>
<li><a href="../modules/systems.html">systems</a></li>
<li><a href="../modules/Assemblages.html">Assemblages</a></li>
<li><a href="../modules/Components.html">Components</a></li>
<li><strong>Concord</strong></li>
<li><a href="../modules/Systems.html">Systems</a></li>
<li><a href="../modules/type.html">type</a></li>
<li><a href="../modules/utils.html">utils</a></li>
<li><a href="../modules/world.html">world</a></li>
<li><a href="../modules/worlds.html">worlds</a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="../classes/Assemblage.html">Assemblage</a></li>
<li><a href="../classes/Component.html">Component</a></li>
<li><a href="../classes/Entity.html">Entity</a></li>
<li><a href="../classes/List.html">List</a></li>
<li><a href="../classes/Pool.html">Pool</a></li>
<li><a href="../classes/System.html">System</a></li>
<li><a href="../classes/World.html">World</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>init</code></h1>
<p>init</p>
<h1>Module <code>Concord</code></h1>
<p></p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Concord.loadComponents">Concord.loadComponents (pathOrFiles)</a></td>
<td class="name" nowrap><a href="#loadComponents">loadComponents (pathOrFiles)</a></td>
<td class="summary">Loads ComponentClasses and puts them in the Components container.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Concord.loadSystems">Concord.loadSystems (pathOrFiles)</a></td>
<td class="name" nowrap><a href="#loadSystems">loadSystems (pathOrFiles)</a></td>
<td class="summary">Loads SystemClasses and puts them in the Systems container.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Concord.loadWorlds">Concord.loadWorlds (pathOrFiles)</a></td>
<td class="name" nowrap><a href="#loadWorlds">loadWorlds (pathOrFiles)</a></td>
<td class="summary">Loads Worlds and puts them in the Worlds container.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Concord.loadAssemblages">Concord.loadAssemblages (pathOrFiles)</a></td>
<td class="name" nowrap><a href="#loadAssemblages">loadAssemblages (pathOrFiles)</a></td>
<td class="summary">Loads Assemblages and puts them in the Assemblages container.</td>
</tr>
</table>
@ -91,8 +94,8 @@
<dl class="function">
<dt>
<a name = "Concord.loadComponents"></a>
<strong>Concord.loadComponents (pathOrFiles)</strong>
<a name = "loadComponents"></a>
<strong>loadComponents (pathOrFiles)</strong>
</dt>
<dd>
Loads ComponentClasses and puts them in the Components container.
@ -113,8 +116,8 @@
</dd>
<dt>
<a name = "Concord.loadSystems"></a>
<strong>Concord.loadSystems (pathOrFiles)</strong>
<a name = "loadSystems"></a>
<strong>loadSystems (pathOrFiles)</strong>
</dt>
<dd>
Loads SystemClasses and puts them in the Systems container.
@ -135,8 +138,8 @@
</dd>
<dt>
<a name = "Concord.loadWorlds"></a>
<strong>Concord.loadWorlds (pathOrFiles)</strong>
<a name = "loadWorlds"></a>
<strong>loadWorlds (pathOrFiles)</strong>
</dt>
<dd>
Loads Worlds and puts them in the Worlds container.
@ -157,8 +160,8 @@
</dd>
<dt>
<a name = "Concord.loadAssemblages"></a>
<strong>Concord.loadAssemblages (pathOrFiles)</strong>
<a name = "loadAssemblages"></a>
<strong>loadAssemblages (pathOrFiles)</strong>
</dt>
<dd>
Loads Assemblages and puts them in the Assemblages container.
@ -185,7 +188,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 00:43:06 </i>
<i style="float:right;">Last updated 2020-01-04 10:27:07 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View file

@ -1,147 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Concord</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><strong>assemblage</strong></li>
<li><a href="../modules/assemblages.html">assemblages</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/components.html">components</a></li>
<li><a href="../modules/entity.html">entity</a></li>
<li><a href="../modules/init.html">init</a></li>
<li><a href="../modules/list.html">list</a></li>
<li><a href="../modules/pool.html">pool</a></li>
<li><a href="../modules/system.html">system</a></li>
<li><a href="../modules/systems.html">systems</a></li>
<li><a href="../modules/type.html">type</a></li>
<li><a href="../modules/utils.html">utils</a></li>
<li><a href="../modules/world.html">world</a></li>
<li><a href="../modules/worlds.html">worlds</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>assemblage</code></h1>
<p>Assemblage
An Assemblage is a function that 'makes' an entity something.</p>
<p>
It does this by :give'ing or :ensure'ing Components, or by :assemble'ing the Entity.</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Assemblage.new">Assemblage.new (assemble)</a></td>
<td class="summary">Creates a new Assemblage.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Assemblage:assemble">Assemblage:assemble (e, ...)</a></td>
<td class="summary">Assembles an Entity.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "Assemblage.new"></a>
<strong>Assemblage.new (assemble)</strong>
</dt>
<dd>
Creates a new Assemblage.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">assemble</span>
Function that assembles an Entity
</li>
</ul>
<h3>Returns:</h3>
<ol>
A new Assemblage
</ol>
</dd>
<dt>
<a name = "Assemblage:assemble"></a>
<strong>Assemblage:assemble (e, ...)</strong>
</dt>
<dd>
Assembles an Entity.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">e</span>
Entity to assemble
</li>
<li><span class="parameter">...</span>
Varargs to pass to the assemble function
@ return self
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 00:43:06 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View file

@ -38,38 +38,48 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/assemblage.html">assemblage</a></li>
<li><strong>assemblages</strong></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/components.html">components</a></li>
<li><a href="../modules/entity.html">entity</a></li>
<li><a href="../modules/init.html">init</a></li>
<li><a href="../modules/list.html">list</a></li>
<li><a href="../modules/pool.html">pool</a></li>
<li><a href="../modules/system.html">system</a></li>
<li><a href="../modules/systems.html">systems</a></li>
<li><strong>Assemblages</strong></li>
<li><a href="../modules/Components.html">Components</a></li>
<li><a href="../modules/Concord.html">Concord</a></li>
<li><a href="../modules/Systems.html">Systems</a></li>
<li><a href="../modules/type.html">type</a></li>
<li><a href="../modules/utils.html">utils</a></li>
<li><a href="../modules/world.html">world</a></li>
<li><a href="../modules/worlds.html">worlds</a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="../classes/Assemblage.html">Assemblage</a></li>
<li><a href="../classes/Component.html">Component</a></li>
<li><a href="../classes/Entity.html">Entity</a></li>
<li><a href="../classes/List.html">List</a></li>
<li><a href="../classes/Pool.html">Pool</a></li>
<li><a href="../classes/System.html">System</a></li>
<li><a href="../classes/World.html">World</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>assemblages</code></h1>
<p>Assemblages
Container for registered Assemblages</p>
<h1>Module <code>Assemblages</code></h1>
<p>A container for registered <a href="../classes/Assemblage.html#">Assemblage</a>s</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Assemblages.register">Assemblages.register (name, assemblage)</a></td>
<td class="name" nowrap><a href="#register">register (name, assemblage)</a></td>
<td class="summary">Registers an Assemblage.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#has">has (name)</a></td>
<td class="summary">Returns true if the containter has an Assemblage with the specified name</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get">get (name)</a></td>
<td class="summary">Returns the Assemblage with the specified name</td>
</tr>
</table>
<br/>
@ -80,8 +90,8 @@
<dl class="function">
<dt>
<a name = "Assemblages.register"></a>
<strong>Assemblages.register (name, assemblage)</strong>
<a name = "register"></a>
<strong>register (name, assemblage)</strong>
</dt>
<dd>
Registers an Assemblage.
@ -90,9 +100,11 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Name to register under
</li>
<li><span class="parameter">assemblage</span>
<span class="types"><a class="type" href="../classes/Assemblage.html#">Assemblage</a></span>
Assemblage to register
</li>
</ul>
@ -101,6 +113,60 @@
</dd>
<dt>
<a name = "has"></a>
<strong>has (name)</strong>
</dt>
<dd>
Returns true if the containter has an Assemblage with the specified name
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Name of the Assemblage to check
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
</ol>
</dd>
<dt>
<a name = "get"></a>
<strong>get (name)</strong>
</dt>
<dd>
Returns the Assemblage with the specified name
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Name of the Assemblage to get
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/Assemblage.html#">Assemblage</a></span>
</ol>
</dd>
</dl>
@ -109,7 +175,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 00:43:06 </i>
<i style="float:right;">Last updated 2020-01-04 10:27:07 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View file

@ -1,166 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Concord</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/assemblage.html">assemblage</a></li>
<li><a href="../modules/assemblages.html">assemblages</a></li>
<li><strong>component</strong></li>
<li><a href="../modules/components.html">components</a></li>
<li><a href="../modules/entity.html">entity</a></li>
<li><a href="../modules/init.html">init</a></li>
<li><a href="../modules/list.html">list</a></li>
<li><a href="../modules/pool.html">pool</a></li>
<li><a href="../modules/system.html">system</a></li>
<li><a href="../modules/systems.html">systems</a></li>
<li><a href="../modules/type.html">type</a></li>
<li><a href="../modules/utils.html">utils</a></li>
<li><a href="../modules/world.html">world</a></li>
<li><a href="../modules/worlds.html">worlds</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>component</code></h1>
<p>Component
A Component is a pure data container.</p>
<p>
A Component is contained by a single entity.</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Component.new">Component.new (populate)</a></td>
<td class="summary">Creates a new ComponentClass.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Component:__populate">Component:__populate ()</a></td>
<td class="summary">Internal: Populates a Component with values</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Component:__initialize">Component:__initialize (...)</a></td>
<td class="summary">Internal: Creates and populates a new Component.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "Component.new"></a>
<strong>Component.new (populate)</strong>
</dt>
<dd>
Creates a new ComponentClass.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">populate</span>
Function that populates a Component with values
</li>
</ul>
<h3>Returns:</h3>
<ol>
A new ComponentClass
</ol>
</dd>
<dt>
<a name = "Component:__populate"></a>
<strong>Component:__populate ()</strong>
</dt>
<dd>
Internal: Populates a Component with values
</dd>
<dt>
<a name = "Component:__initialize"></a>
<strong>Component:__initialize (...)</strong>
</dt>
<dd>
Internal: Creates and populates a new Component.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
Varargs passed to the populate function
</li>
</ul>
<h3>Returns:</h3>
<ol>
A new populated Component
</ol>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 00:43:06 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View file

@ -38,38 +38,48 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/assemblage.html">assemblage</a></li>
<li><a href="../modules/assemblages.html">assemblages</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><strong>components</strong></li>
<li><a href="../modules/entity.html">entity</a></li>
<li><a href="../modules/init.html">init</a></li>
<li><a href="../modules/list.html">list</a></li>
<li><a href="../modules/pool.html">pool</a></li>
<li><a href="../modules/system.html">system</a></li>
<li><a href="../modules/systems.html">systems</a></li>
<li><a href="../modules/Assemblages.html">Assemblages</a></li>
<li><strong>Components</strong></li>
<li><a href="../modules/Concord.html">Concord</a></li>
<li><a href="../modules/Systems.html">Systems</a></li>
<li><a href="../modules/type.html">type</a></li>
<li><a href="../modules/utils.html">utils</a></li>
<li><a href="../modules/world.html">world</a></li>
<li><a href="../modules/worlds.html">worlds</a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="../classes/Assemblage.html">Assemblage</a></li>
<li><a href="../classes/Component.html">Component</a></li>
<li><a href="../classes/Entity.html">Entity</a></li>
<li><a href="../classes/List.html">List</a></li>
<li><a href="../classes/Pool.html">Pool</a></li>
<li><a href="../classes/System.html">System</a></li>
<li><a href="../classes/World.html">World</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>components</code></h1>
<p>Components
Container for registered ComponentClasss</p>
<h1>Module <code>Components</code></h1>
<p>Container for registered ComponentClasses</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Components.register">Components.register (name, componentClass)</a></td>
<td class="name" nowrap><a href="#register">register (name, componentClass)</a></td>
<td class="summary">Registers a ComponentClass.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#has">has (name)</a></td>
<td class="summary">Returns true if the containter has the ComponentClass with the specified name</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get">get (name)</a></td>
<td class="summary">Returns the ComponentClass with the specified name</td>
</tr>
</table>
<br/>
@ -80,8 +90,8 @@
<dl class="function">
<dt>
<a name = "Components.register"></a>
<strong>Components.register (name, componentClass)</strong>
<a name = "register"></a>
<strong>register (name, componentClass)</strong>
</dt>
<dd>
Registers a ComponentClass.
@ -90,9 +100,11 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Name to register under
</li>
<li><span class="parameter">componentClass</span>
<span class="types"><a class="type" href="../classes/Component.html#">Component</a></span>
ComponentClass to register
</li>
</ul>
@ -101,6 +113,60 @@
</dd>
<dt>
<a name = "has"></a>
<strong>has (name)</strong>
</dt>
<dd>
Returns true if the containter has the ComponentClass with the specified name
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Name of the ComponentClass to check
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
</ol>
</dd>
<dt>
<a name = "get"></a>
<strong>get (name)</strong>
</dt>
<dd>
Returns the ComponentClass with the specified name
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Name of the ComponentClass to get
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/Component.html#">Component</a></span>
</ol>
</dd>
</dl>
@ -109,7 +175,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 00:43:06 </i>
<i style="float:right;">Last updated 2020-01-04 10:27:07 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View file

@ -38,38 +38,48 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/assemblage.html">assemblage</a></li>
<li><a href="../modules/assemblages.html">assemblages</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/components.html">components</a></li>
<li><a href="../modules/entity.html">entity</a></li>
<li><a href="../modules/init.html">init</a></li>
<li><a href="../modules/list.html">list</a></li>
<li><a href="../modules/pool.html">pool</a></li>
<li><a href="../modules/system.html">system</a></li>
<li><strong>systems</strong></li>
<li><a href="../modules/Assemblages.html">Assemblages</a></li>
<li><a href="../modules/Components.html">Components</a></li>
<li><a href="../modules/Concord.html">Concord</a></li>
<li><strong>Systems</strong></li>
<li><a href="../modules/type.html">type</a></li>
<li><a href="../modules/utils.html">utils</a></li>
<li><a href="../modules/world.html">world</a></li>
<li><a href="../modules/worlds.html">worlds</a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="../classes/Assemblage.html">Assemblage</a></li>
<li><a href="../classes/Component.html">Component</a></li>
<li><a href="../classes/Entity.html">Entity</a></li>
<li><a href="../classes/List.html">List</a></li>
<li><a href="../classes/Pool.html">Pool</a></li>
<li><a href="../classes/System.html">System</a></li>
<li><a href="../classes/World.html">World</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>systems</code></h1>
<p>Systems
Container for registered SystemClasses</p>
<h1>Module <code>Systems</code></h1>
<p>Container for registered SystemClasses</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Systems.register">Systems.register (name, systemClass)</a></td>
<td class="name" nowrap><a href="#register">register (name, systemClass)</a></td>
<td class="summary">Registers a SystemClass.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#has">has (name)</a></td>
<td class="summary">Returns true if the containter has the SystemClass with the name</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get">get (name)</a></td>
<td class="summary">Returns the SystemClass with the name</td>
</tr>
</table>
<br/>
@ -80,8 +90,8 @@
<dl class="function">
<dt>
<a name = "Systems.register"></a>
<strong>Systems.register (name, systemClass)</strong>
<a name = "register"></a>
<strong>register (name, systemClass)</strong>
</dt>
<dd>
Registers a SystemClass.
@ -90,9 +100,11 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Name to register under
</li>
<li><span class="parameter">systemClass</span>
<span class="types"><a class="type" href="../classes/System.html#">System</a></span>
SystemClass to register
</li>
</ul>
@ -101,6 +113,59 @@
</dd>
<dt>
<a name = "has"></a>
<strong>has (name)</strong>
</dt>
<dd>
Returns true if the containter has the SystemClass with the name
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Name of the SystemClass to check
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
</ol>
</dd>
<dt>
<a name = "get"></a>
<strong>get (name)</strong>
</dt>
<dd>
Returns the SystemClass with the name
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Name of the SystemClass to get
</li>
</ul>
<h3>Returns:</h3>
<ol>
SystemClass with the name
</ol>
</dd>
</dl>
@ -109,7 +174,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 00:43:06 </i>
<i style="float:right;">Last updated 2020-01-04 10:27:07 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View file

@ -38,21 +38,24 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/assemblage.html">assemblage</a></li>
<li><a href="../modules/assemblages.html">assemblages</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/components.html">components</a></li>
<li><a href="../modules/entity.html">entity</a></li>
<li><a href="../modules/init.html">init</a></li>
<li><a href="../modules/list.html">list</a></li>
<li><a href="../modules/pool.html">pool</a></li>
<li><a href="../modules/system.html">system</a></li>
<li><a href="../modules/systems.html">systems</a></li>
<li><a href="../modules/Assemblages.html">Assemblages</a></li>
<li><a href="../modules/Components.html">Components</a></li>
<li><a href="../modules/Concord.html">Concord</a></li>
<li><a href="../modules/Systems.html">Systems</a></li>
<li><strong>type</strong></li>
<li><a href="../modules/utils.html">utils</a></li>
<li><a href="../modules/world.html">world</a></li>
<li><a href="../modules/worlds.html">worlds</a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="../classes/Assemblage.html">Assemblage</a></li>
<li><a href="../classes/Component.html">Component</a></li>
<li><a href="../classes/Entity.html">Entity</a></li>
<li><a href="../classes/List.html">List</a></li>
<li><a href="../classes/Pool.html">Pool</a></li>
<li><a href="../classes/System.html">System</a></li>
<li><a href="../classes/World.html">World</a></li>
</ul>
</div>
@ -121,7 +124,8 @@
<h3>Returns:</h3>
<ol>
True if object is an Entity, false otherwise
<span class="types"><span class="type">boolean</span></span>
</ol>
@ -146,7 +150,8 @@
<h3>Returns:</h3>
<ol>
True if object is an ComponentClass, false otherwise
<span class="types"><span class="type">boolean</span></span>
</ol>
@ -171,7 +176,8 @@
<h3>Returns:</h3>
<ol>
True if object is an Component, false otherwise
<span class="types"><span class="type">boolean</span></span>
</ol>
@ -196,7 +202,8 @@
<h3>Returns:</h3>
<ol>
True if object is an SystemClass, false otherwise
<span class="types"><span class="type">boolean</span></span>
</ol>
@ -221,7 +228,8 @@
<h3>Returns:</h3>
<ol>
True if object is an System, false otherwise
<span class="types"><span class="type">boolean</span></span>
</ol>
@ -246,7 +254,8 @@
<h3>Returns:</h3>
<ol>
True if object is an World, false otherwise
<span class="types"><span class="type">boolean</span></span>
</ol>
@ -271,7 +280,8 @@
<h3>Returns:</h3>
<ol>
True if object is an Assemblage, false otherwise
<span class="types"><span class="type">boolean</span></span>
</ol>
@ -285,7 +295,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 00:43:06 </i>
<i style="float:right;">Last updated 2020-01-04 10:27:07 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View file

@ -38,21 +38,24 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/assemblage.html">assemblage</a></li>
<li><a href="../modules/assemblages.html">assemblages</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/components.html">components</a></li>
<li><a href="../modules/entity.html">entity</a></li>
<li><a href="../modules/init.html">init</a></li>
<li><a href="../modules/list.html">list</a></li>
<li><a href="../modules/pool.html">pool</a></li>
<li><a href="../modules/system.html">system</a></li>
<li><a href="../modules/systems.html">systems</a></li>
<li><a href="../modules/Assemblages.html">Assemblages</a></li>
<li><a href="../modules/Components.html">Components</a></li>
<li><a href="../modules/Concord.html">Concord</a></li>
<li><a href="../modules/Systems.html">Systems</a></li>
<li><a href="../modules/type.html">type</a></li>
<li><strong>utils</strong></li>
<li><a href="../modules/world.html">world</a></li>
<li><a href="../modules/worlds.html">worlds</a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="../classes/Assemblage.html">Assemblage</a></li>
<li><a href="../classes/Component.html">Component</a></li>
<li><a href="../classes/Entity.html">Entity</a></li>
<li><a href="../classes/List.html">List</a></li>
<li><a href="../classes/Pool.html">Pool</a></li>
<li><a href="../classes/System.html">System</a></li>
<li><a href="../classes/World.html">World</a></li>
</ul>
</div>
@ -109,7 +112,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 00:43:06 </i>
<i style="float:right;">Last updated 2020-01-04 10:27:07 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View file

@ -38,21 +38,24 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/assemblage.html">assemblage</a></li>
<li><a href="../modules/assemblages.html">assemblages</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/components.html">components</a></li>
<li><a href="../modules/entity.html">entity</a></li>
<li><a href="../modules/init.html">init</a></li>
<li><a href="../modules/list.html">list</a></li>
<li><a href="../modules/pool.html">pool</a></li>
<li><a href="../modules/system.html">system</a></li>
<li><a href="../modules/systems.html">systems</a></li>
<li><a href="../modules/Assemblages.html">Assemblages</a></li>
<li><a href="../modules/Components.html">Components</a></li>
<li><a href="../modules/Concord.html">Concord</a></li>
<li><a href="../modules/Systems.html">Systems</a></li>
<li><a href="../modules/type.html">type</a></li>
<li><a href="../modules/utils.html">utils</a></li>
<li><a href="../modules/world.html">world</a></li>
<li><strong>worlds</strong></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="../classes/Assemblage.html">Assemblage</a></li>
<li><a href="../classes/Component.html">Component</a></li>
<li><a href="../classes/Entity.html">Entity</a></li>
<li><a href="../classes/List.html">List</a></li>
<li><a href="../classes/Pool.html">Pool</a></li>
<li><a href="../classes/System.html">System</a></li>
<li><a href="../classes/World.html">World</a></li>
</ul>
</div>
@ -70,6 +73,14 @@
<td class="name" nowrap><a href="#Worlds.register">Worlds.register (name, world)</a></td>
<td class="summary">Registers a World.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Worlds.has">Worlds.has (name)</a></td>
<td class="summary">Returns true if the containter has the World with the name</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Worlds.get">Worlds.get (name)</a></td>
<td class="summary">Returns the World with the name</td>
</tr>
</table>
<br/>
@ -90,6 +101,7 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Name to register under
</li>
<li><span class="parameter">world</span>
@ -101,6 +113,59 @@
</dd>
<dt>
<a name = "Worlds.has"></a>
<strong>Worlds.has (name)</strong>
</dt>
<dd>
Returns true if the containter has the World with the name
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Name of the World to check
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">boolean</span></span>
</ol>
</dd>
<dt>
<a name = "Worlds.get"></a>
<strong>Worlds.get (name)</strong>
</dt>
<dd>
Returns the World with the name
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Name of the World to get
</li>
</ul>
<h3>Returns:</h3>
<ol>
World with the name
</ol>
</dd>
</dl>
@ -109,7 +174,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-01-04 00:43:06 </i>
<i style="float:right;">Last updated 2020-01-04 10:27:07 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>