Added docs

* Added a "nothing docstring" at the top of each file we want to generate docs for. We have to do this or ldoc just straight up refuses to generate docs otherwise.
* Fixed up a few incorrect docstrings
* config.ld is the config file for ldoc

These still need some work: a bunch of functions are still undocumented and also: type.lua & run.lua are completely undocumented.
This commit is contained in:
Josh Perry 2018-09-25 18:47:20 +01:00
parent d53a931c3a
commit 67d67aad5f
17 changed files with 2195 additions and 3 deletions

View file

@ -1,3 +1,5 @@
--- Component
local Component = {}
Component.__index = Component

View file

@ -1,3 +1,5 @@
--- Entity
local PATH = (...):gsub('%.[^%.]+$', '')
local Type = require(PATH..".type")
@ -87,7 +89,7 @@ function Entity:get(component)
end
--- Returns true if the Entity has the Component.
-- @params component The Component to check against
-- @param component The Component to check against
-- @return True if the entity has the Bag. False otherwise
function Entity:has(component)
if not Type.isComponent(component) then

View file

@ -1,3 +1,5 @@
--- init
local PATH = (...):gsub('%.init$', '')
local Type = require(PATH..".type")

View file

@ -1,3 +1,5 @@
--- Instance
local PATH = (...):gsub('%.[^%.]+$', '')
local Entity = require(PATH..".entity")

View file

@ -1,3 +1,5 @@
--- List
local List = {}
local mt = {__index = List}
@ -66,7 +68,7 @@ end
--- Gets if the List has the object.
-- @param obj The object to search for
-- @param true if the list has the object, false otherwise
-- true if the list has the object, false otherwise
function List:has(obj)
return self.pointers[obj] and true
end

View file

@ -1,3 +1,5 @@
--- Pool
local PATH = (...):gsub('%.[^%.]+$', '')
local List = require(PATH..".list")

View file

@ -1,3 +1,5 @@
--- System
local PATH = (...):gsub('%.[^%.]+$', '')
local Component = require(PATH..".component")
@ -129,7 +131,7 @@ function System:getInstance()
end
--- Returns if the System has the Entity.
-- @param The Entity to check for
-- @param e The Entity to check for
-- @return True if the System has the Entity. False otherwise
function System:__has(e)
return self.__all[e] and true