diff --git a/config.ld b/config.ld new file mode 100644 index 0000000..aada8c2 --- /dev/null +++ b/config.ld @@ -0,0 +1,3 @@ +project = 'Concord' +description = 'A feature-complete ECS library' +file = {'lib', exclude = {'lib/type.lua', 'lib/run.lua'}} \ No newline at end of file diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 0000000..746fc48 --- /dev/null +++ b/doc/index.html @@ -0,0 +1,90 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ + +

A feature-complete ECS library

+ +

Modules

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
componentComponent
entityEntity
initinit
instanceInstance
listList
poolPool
systemSystem
+ +
+
+
+generated by LDoc 1.4.6 +Last updated 2018-09-25 18:42:43 +
+
+ + diff --git a/doc/ldoc.css b/doc/ldoc.css new file mode 100644 index 0000000..52c4ad2 --- /dev/null +++ b/doc/ldoc.css @@ -0,0 +1,303 @@ +/* BEGIN RESET + +Copyright (c) 2010, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 +*/ +html { + color: #000; + background: #FFF; +} +body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td { + margin: 0; + padding: 0; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +fieldset,img { + border: 0; +} +address,caption,cite,code,dfn,em,strong,th,var,optgroup { + font-style: inherit; + font-weight: inherit; +} +del,ins { + text-decoration: none; +} +li { + margin-left: 20px; +} +caption,th { + text-align: left; +} +h1,h2,h3,h4,h5,h6 { + font-size: 100%; + font-weight: bold; +} +q:before,q:after { + content: ''; +} +abbr,acronym { + border: 0; + font-variant: normal; +} +sup { + vertical-align: baseline; +} +sub { + vertical-align: baseline; +} +legend { + color: #000; +} +input,button,textarea,select,optgroup,option { + font-family: inherit; + font-size: inherit; + font-style: inherit; + font-weight: inherit; +} +input,button,textarea,select {*font-size:100%; +} +/* END RESET */ + +body { + margin-left: 1em; + margin-right: 1em; + font-family: arial, helvetica, geneva, sans-serif; + background-color: #ffffff; margin: 0px; +} + +code, tt { font-family: monospace; font-size: 1.1em; } +span.parameter { font-family:monospace; } +span.parameter:after { content:":"; } +span.types:before { content:"("; } +span.types:after { content:")"; } +.type { font-weight: bold; font-style:italic } + +body, p, td, th { font-size: .95em; line-height: 1.2em;} + +p, ul { margin: 10px 0 0 0px;} + +strong { font-weight: bold;} + +em { font-style: italic;} + +h1 { + font-size: 1.5em; + margin: 20px 0 20px 0; +} +h2, h3, h4 { margin: 15px 0 10px 0; } +h2 { font-size: 1.25em; } +h3 { font-size: 1.15em; } +h4 { font-size: 1.06em; } + +a:link { font-weight: bold; color: #004080; text-decoration: none; } +a:visited { font-weight: bold; color: #006699; text-decoration: none; } +a:link:hover { text-decoration: underline; } + +hr { + color:#cccccc; + background: #00007f; + height: 1px; +} + +blockquote { margin-left: 3em; } + +ul { list-style-type: disc; } + +p.name { + font-family: "Andale Mono", monospace; + padding-top: 1em; +} + +pre { + background-color: rgb(245, 245, 245); + border: 1px solid #C0C0C0; /* silver */ + padding: 10px; + margin: 10px 0 10px 0; + overflow: auto; + font-family: "Andale Mono", monospace; +} + +pre.example { + font-size: .85em; +} + +table.index { border: 1px #00007f; } +table.index td { text-align: left; vertical-align: top; } + +#container { + margin-left: 1em; + margin-right: 1em; + background-color: #f0f0f0; +} + +#product { + text-align: center; + border-bottom: 1px solid #cccccc; + background-color: #ffffff; +} + +#product big { + font-size: 2em; +} + +#main { + background-color: #f0f0f0; + border-left: 2px solid #cccccc; +} + +#navigation { + float: left; + width: 14em; + vertical-align: top; + background-color: #f0f0f0; + overflow: visible; +} + +#navigation h2 { + background-color:#e7e7e7; + font-size:1.1em; + color:#000000; + text-align: left; + padding:0.2em; + border-top:1px solid #dddddd; + border-bottom:1px solid #dddddd; +} + +#navigation ul +{ + font-size:1em; + list-style-type: none; + margin: 1px 1px 10px 1px; +} + +#navigation li { + text-indent: -1em; + display: block; + margin: 3px 0px 0px 22px; +} + +#navigation li li a { + margin: 0px 3px 0px -1em; +} + +#content { + margin-left: 14em; + padding: 1em; + width: 700px; + border-left: 2px solid #cccccc; + border-right: 2px solid #cccccc; + background-color: #ffffff; +} + +#about { + clear: both; + padding: 5px; + border-top: 2px solid #cccccc; + background-color: #ffffff; +} + +@media print { + body { + font: 12pt "Times New Roman", "TimeNR", Times, serif; + } + a { font-weight: bold; color: #004080; text-decoration: underline; } + + #main { + background-color: #ffffff; + border-left: 0px; + } + + #container { + margin-left: 2%; + margin-right: 2%; + background-color: #ffffff; + } + + #content { + padding: 1em; + background-color: #ffffff; + } + + #navigation { + display: none; + } + pre.example { + font-family: "Andale Mono", monospace; + font-size: 10pt; + page-break-inside: avoid; + } +} + +table.module_list { + border-width: 1px; + border-style: solid; + border-color: #cccccc; + border-collapse: collapse; +} +table.module_list td { + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; +} +table.module_list td.name { background-color: #f0f0f0; min-width: 200px; } +table.module_list td.summary { width: 100%; } + + +table.function_list { + border-width: 1px; + border-style: solid; + border-color: #cccccc; + border-collapse: collapse; +} +table.function_list td { + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; +} +table.function_list td.name { background-color: #f0f0f0; min-width: 200px; } +table.function_list td.summary { width: 100%; } + +ul.nowrap { + overflow:auto; + white-space:nowrap; +} + +dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;} +dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;} +dl.table h3, dl.function h3 {font-size: .95em;} + +/* stop sublists from having initial vertical space */ +ul ul { margin-top: 0px; } +ol ul { margin-top: 0px; } +ol ol { margin-top: 0px; } +ul ol { margin-top: 0px; } + +/* make the target distinct; helps when we're navigating to a function */ +a:target + * { + background-color: #FF9; +} + + +/* styles for prettification of source */ +pre .comment { color: #558817; } +pre .constant { color: #a8660d; } +pre .escape { color: #844631; } +pre .keyword { color: #aa5050; font-weight: bold; } +pre .library { color: #0e7c6b; } +pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; } +pre .string { color: #8080ff; } +pre .number { color: #f8660d; } +pre .operator { color: #2239a8; font-weight: bold; } +pre .preprocessor, pre .prepro { color: #a33243; } +pre .global { color: #800080; } +pre .user-keyword { color: #800080; } +pre .prompt { color: #558817; } +pre .url { color: #272fc2; text-decoration: underline; } + diff --git a/doc/modules/component.html b/doc/modules/component.html new file mode 100644 index 0000000..37f2162 --- /dev/null +++ b/doc/modules/component.html @@ -0,0 +1,139 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module component

+

Component

+

+ + +

Functions

+ + + + + + + + + +
Component.new (populate)Creates a new Component.
Component:__initialize (...)Creates and initializes a new Bag.
+ +
+
+ + +

Functions

+ +
+
+ + Component.new (populate) +
+
+ Creates a new Component. + + +

Parameters:

+
    +
  • populate + A function that populates the Bag with values +
  • +
+ +

Returns:

+
    + + A Component object +
+ + + + +
+
+ + Component:__initialize (...) +
+
+ Creates and initializes a new Bag. + + +

Parameters:

+
    +
  • ... + The values passed to the populate function +
  • +
+ +

Returns:

+
    + + A new initialized Bag +
+ + + + +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2018-09-25 18:42:43 +
+
+ + diff --git a/doc/modules/entity.html b/doc/modules/entity.html new file mode 100644 index 0000000..34281f0 --- /dev/null +++ b/doc/modules/entity.html @@ -0,0 +1,269 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module entity

+

Entity

+

+ + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Entity.new ()Creates and initializes a new Entity.
Entity:give (component, ...)Gives an Entity a component with values.
Entity:remove (component)Removes a component from an Entity.
Entity:apply ()Checks the Entity against the pools again.
Entity:destroy ()Destroys the Entity.
Entity:get (component)Gets a Component from the Entity.
Entity:has (component)Returns true if the Entity has the Component.
+ +
+
+ + +

Functions

+ +
+
+ + Entity.new () +
+
+ Creates and initializes a new Entity. + + + +

Returns:

+
    + + A new Entity +
+ + + + +
+
+ + Entity:give (component, ...) +
+
+ Gives an Entity a component with values. + + +

Parameters:

+
    +
  • component + The Component to add +
  • +
  • ... + The values passed to the Component +
  • +
+ +

Returns:

+
    + + self +
+ + + + +
+
+ + Entity:remove (component) +
+
+ Removes a component from an Entity. + + +

Parameters:

+
    +
  • component + The Component to remove +
  • +
+ +

Returns:

+
    + + self +
+ + + + +
+
+ + Entity:apply () +
+
+ Checks the Entity against the pools again. + + + +

Returns:

+
    + + self +
+ + + + +
+
+ + Entity:destroy () +
+
+ Destroys the Entity. + + + +

Returns:

+
    + + self +
+ + + + +
+
+ + Entity:get (component) +
+
+ Gets a Component from the Entity. + + +

Parameters:

+
    +
  • component + The Component to get +
  • +
+ +

Returns:

+
    + + The Bag from the Component +
+ + + + +
+
+ + Entity:has (component) +
+
+ Returns true if the Entity has the Component. + + +

Parameters:

+
    +
  • component + The Component to check against +
  • +
+ +

Returns:

+
    + + True if the entity has the Bag. False otherwise +
+ + + + +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2018-09-25 18:42:43 +
+
+ + diff --git a/doc/modules/init.html b/doc/modules/init.html new file mode 100644 index 0000000..163ad9e --- /dev/null +++ b/doc/modules/init.html @@ -0,0 +1,112 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module init

+

init

+

+ + +

Functions

+ + + + + +
Concord.init (settings)Initializes the library with some optional settings
+ +
+
+ + +

Functions

+ +
+
+ + Concord.init (settings) +
+
+ Initializes the library with some optional settings + + +

Parameters:

+
    +
  • settings + Table of settings: { + useEvents Flag to overwrite love.run and use events. Defaults to false + } +
  • +
+ +

Returns:

+
    + + Concord +
+ + + + +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2018-09-25 18:42:43 +
+
+ + diff --git a/doc/modules/instance.html b/doc/modules/instance.html new file mode 100644 index 0000000..d79a6c5 --- /dev/null +++ b/doc/modules/instance.html @@ -0,0 +1,463 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module instance

+

Instance

+

+ + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Instance.new ()Creates a new Instance.
Instance:addEntity (e)Adds an Entity to the Instance.
Instance:checkEntity (e)Checks an Entity against all the systems in the Instance.
Instance:removeEntity (e)Marks an Entity as removed from the Instance.
Instance:flush ()Completely removes all marked Entities in the Instance.
Instance:addSystem (system, eventName, callback, enabled)Adds a System to the Instance.
Instance:enableSystem (system, eventName, callback)Enables a System in the Instance.
Instance:disableSystem (system, eventName, callback)Disables a System in the Instance.
Instance:setSystem (system, eventName, callback, enable)Sets a System 'enable' in the Instance.
Instance:emit (eventName, ...)Emits an Event in the Instance.
Instance:clear ()Removes all entities from the Instance
Instance:onEntityAdded (e)Default callback for adding an Entity.
Instance:onEntityRemoved (e)Default callback for removing an Entity.
+ +
+
+ + +

Functions

+ +
+
+ + Instance.new () +
+
+ Creates a new Instance. + + + +

Returns:

+
    + + The new instance +
+ + + + +
+
+ + Instance:addEntity (e) +
+
+ Adds an Entity to the Instance. + + +

Parameters:

+
    +
  • e + The Entity to add +
  • +
+ +

Returns:

+
    + + self +
+ + + + +
+
+ + Instance:checkEntity (e) +
+
+ Checks an Entity against all the systems in the Instance. + + +

Parameters:

+
    +
  • e + The Entity to check +
  • +
+ +

Returns:

+
    + + self +
+ + + + +
+
+ + Instance:removeEntity (e) +
+
+ Marks an Entity as removed from the Instance. + + +

Parameters:

+
    +
  • e + The Entity to mark +
  • +
+ +

Returns:

+
    + + self +
+ + + + +
+
+ + Instance:flush () +
+
+ Completely removes all marked Entities in the Instance. + + + +

Returns:

+
    + + self +
+ + + + +
+
+ + Instance:addSystem (system, eventName, callback, enabled) +
+
+ Adds a System to the Instance. + + +

Parameters:

+
    +
  • system + The System to add +
  • +
  • eventName + The Event to register to +
  • +
  • callback + The function name to call. Defaults to eventName +
  • +
  • enabled + If the system is enabled. Defaults to true +
  • +
+ +

Returns:

+
    + + self +
+ + + + +
+
+ + Instance:enableSystem (system, eventName, callback) +
+
+ Enables a System in the Instance. + + +

Parameters:

+
    +
  • system + The System to enable +
  • +
  • eventName + The Event it was registered to +
  • +
  • callback + The callback it was registered with. Defaults to eventName +
  • +
+ +

Returns:

+
    + + self +
+ + + + +
+
+ + Instance:disableSystem (system, eventName, callback) +
+
+ Disables a System in the Instance. + + +

Parameters:

+
    +
  • system + The System to disable +
  • +
  • eventName + The Event it was registered to +
  • +
  • callback + The callback it was registered with. Defaults to eventName +
  • +
+ +

Returns:

+
    + + self +
+ + + + +
+
+ + Instance:setSystem (system, eventName, callback, enable) +
+
+ Sets a System 'enable' in the Instance. + + +

Parameters:

+
    +
  • system + The System to set +
  • +
  • eventName + The Event it was registered to +
  • +
  • callback + The callback it was registered with. Defaults to eventName +
  • +
  • enable + The state to set it to +
  • +
+ +

Returns:

+
    + + self +
+ + + + +
+
+ + Instance:emit (eventName, ...) +
+
+ Emits an Event in the Instance. + + +

Parameters:

+
    +
  • eventName + The Event that should be emitted +
  • +
  • ... + Parameters passed to listeners +
  • +
+ +

Returns:

+
    + + self +
+ + + + +
+
+ + Instance:clear () +
+
+ Removes all entities from the Instance + + + +

Returns:

+
    + + self +
+ + + + +
+
+ + Instance:onEntityAdded (e) +
+
+ Default callback for adding an Entity. + + +

Parameters:

+
    +
  • e + The Entity that was added +
  • +
+ + + + + +
+
+ + Instance:onEntityRemoved (e) +
+
+ Default callback for removing an Entity. + + +

Parameters:

+
    +
  • e + The Entity that was removed +
  • +
+ + + + + +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2018-09-25 18:42:43 +
+
+ + diff --git a/doc/modules/list.html b/doc/modules/list.html new file mode 100644 index 0000000..8d384f5 --- /dev/null +++ b/doc/modules/list.html @@ -0,0 +1,239 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module list

+

List

+

+ + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + +
List.new ()Creates a new List.
List:clear ()Clears the List completely.
List:add (obj)Adds an object to the List.
List:remove (obj)Removes an object from the List.
List:get (index)Gets an object by numerical index.
List:has (obj)Gets if the List has the object.
+ +
+
+ + +

Functions

+ +
+
+ + List.new () +
+
+ Creates a new List. + + + +

Returns:

+
    + + A new list +
+ + + + +
+
+ + List:clear () +
+
+ Clears the List completely. + + + +

Returns:

+
    + + self +
+ + + + +
+
+ + List:add (obj) +
+
+ Adds an object to the List. + + +

Parameters:

+
    +
  • obj + The object to add +
  • +
+ +

Returns:

+
    + + self +
+ + + + +
+
+ + List:remove (obj) +
+
+ Removes an object from the List. + + +

Parameters:

+
    +
  • obj + The object to remove +
  • +
+ +

Returns:

+
    + + self +
+ + + + +
+
+ + List:get (index) +
+
+ Gets an object by numerical index. + + +

Parameters:

+
    +
  • index + The index to look at +
  • +
+ +

Returns:

+
    + + The object at the index +
+ + + + +
+
+ + List:has (obj) +
+
+ Gets if the List has the object. + + +

Parameters:

+
    +
  • obj + The object to search for + true if the list has the object, false otherwise +
  • +
+ + + + + +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2018-09-25 18:42:43 +
+
+ + diff --git a/doc/modules/pool.html b/doc/modules/pool.html new file mode 100644 index 0000000..4111b1e --- /dev/null +++ b/doc/modules/pool.html @@ -0,0 +1,142 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module pool

+

Pool

+

+ + +

Functions

+ + + + + + + + + +
Pool.new (name, filter)Creates a new Pool
Pool:eligible (e)Checks if an Entity is eligible for the Pool.
+ +
+
+ + +

Functions

+ +
+
+ + Pool.new (name, filter) +
+
+ Creates a new Pool + + +

Parameters:

+
    +
  • name + Identifier for the Pool. +
  • +
  • filter + Table containing the required Components +
  • +
+ +

Returns:

+
    + + The new Pool +
+ + + + +
+
+ + Pool:eligible (e) +
+
+ Checks if an Entity is eligible for the Pool. + + +

Parameters:

+
    +
  • e + The Entity to check +
  • +
+ +

Returns:

+
    + + True if the entity is eligible, false otherwise +
+ + + + +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2018-09-25 18:42:43 +
+
+ + diff --git a/doc/modules/system.html b/doc/modules/system.html new file mode 100644 index 0000000..8f14c13 --- /dev/null +++ b/doc/modules/system.html @@ -0,0 +1,418 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module system

+

System

+

+ + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
System.new (...)Creates a new System prototype.
System:__buildPool (baseFilter)Builds a Pool for the System.
System:__check (e)Checks and applies an Entity to the System's pools.
System:__remove (e)Removed an Entity from the System.
System:__tryAdd (e)Tries to add an Entity to the System.
System:__tryRemove (e)Tries to remove an Entity from the System.
System:getInstance ()Returns the Instance the System is in.
System:__has (e)Returns if the System has the Entity.
System:init (...)Default callback for system initialization.
System:entityAdded (e)Default callback for adding an Entity.
System:entityAddedTo (e, pool)Default callback for adding an Entity to a pool.
System:entityRemoved (e)Default callback for removing an Entity.
System:entityRemovedFrom (e, pool)Default callback for removing an Entity from a pool.
+ +
+
+ + +

Functions

+ +
+
+ + System.new (...) +
+
+ Creates a new System prototype. + + +

Parameters:

+
    +
  • ... + Variable amounts of filters +
  • +
+ +

Returns:

+
    + + A new System prototype +
+ + + + +
+
+ + System:__buildPool (baseFilter) +
+
+ Builds a Pool for the System. + + +

Parameters:

+
    +
  • baseFilter + The 'raw' Filter +
  • +
+ +

Returns:

+
    + + A new Pool +
+ + + + +
+
+ + System:__check (e) +
+
+ Checks and applies an Entity to the System's pools. + + +

Parameters:

+
    +
  • e + The Entity to check +
  • +
+ +

Returns:

+
    + + True if the Entity was added, false if it was removed. Nil if nothing happend +
+ + + + +
+
+ + System:__remove (e) +
+
+ Removed an Entity from the System. + + +

Parameters:

+
    +
  • e + The Entity to remove +
  • +
+ + + + + +
+
+ + System:__tryAdd (e) +
+
+ Tries to add an Entity to the System. + + +

Parameters:

+
    +
  • e + The Entity to add +
  • +
+ + + + + +
+
+ + System:__tryRemove (e) +
+
+ Tries to remove an Entity from the System. + + +

Parameters:

+
    +
  • e + The Entity to remove +
  • +
+ + + + + +
+
+ + System:getInstance () +
+
+ Returns the Instance the System is in. + + + +

Returns:

+
    + + The Instance +
+ + + + +
+
+ + System:__has (e) +
+
+ Returns if the System has the Entity. + + +

Parameters:

+
    +
  • e + The Entity to check for +
  • +
+ +

Returns:

+
    + + True if the System has the Entity. False otherwise +
+ + + + +
+
+ + System:init (...) +
+
+ Default callback for system initialization. + + +

Parameters:

+
    +
  • ... + Varags +
  • +
+ + + + + +
+
+ + System:entityAdded (e) +
+
+ Default callback for adding an Entity. + + +

Parameters:

+
    +
  • e + The Entity that was added +
  • +
+ + + + + +
+
+ + System:entityAddedTo (e, pool) +
+
+ Default callback for adding an Entity to a pool. + + +

Parameters:

+
    +
  • e + The Entity that was added +
  • +
  • pool + The pool the Entity was added to +
  • +
+ + + + + +
+
+ + System:entityRemoved (e) +
+
+ Default callback for removing an Entity. + + +

Parameters:

+
    +
  • e + The Entity that was removed +
  • +
+ + + + + +
+
+ + System:entityRemovedFrom (e, pool) +
+
+ Default callback for removing an Entity from a pool. + + +

Parameters:

+
    +
  • e + The Entity that was removed +
  • +
  • pool + The pool the Entity was removed from +
  • +
+ + + + + +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2018-09-25 18:42:43 +
+
+ + diff --git a/lib/component.lua b/lib/component.lua index 915d608..5696968 100644 --- a/lib/component.lua +++ b/lib/component.lua @@ -1,3 +1,5 @@ +--- Component + local Component = {} Component.__index = Component diff --git a/lib/entity.lua b/lib/entity.lua index e637277..68fedeb 100644 --- a/lib/entity.lua +++ b/lib/entity.lua @@ -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 diff --git a/lib/init.lua b/lib/init.lua index c0d2398..76f2588 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -1,3 +1,5 @@ +--- init + local PATH = (...):gsub('%.init$', '') local Type = require(PATH..".type") diff --git a/lib/instance.lua b/lib/instance.lua index c3f097e..f2a947e 100644 --- a/lib/instance.lua +++ b/lib/instance.lua @@ -1,3 +1,5 @@ +--- Instance + local PATH = (...):gsub('%.[^%.]+$', '') local Entity = require(PATH..".entity") diff --git a/lib/list.lua b/lib/list.lua index 2d60018..33b2c10 100644 --- a/lib/list.lua +++ b/lib/list.lua @@ -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 diff --git a/lib/pool.lua b/lib/pool.lua index 0e91a0a..c2d1ab4 100644 --- a/lib/pool.lua +++ b/lib/pool.lua @@ -1,3 +1,5 @@ +--- Pool + local PATH = (...):gsub('%.[^%.]+$', '') local List = require(PATH..".list") diff --git a/lib/system.lua b/lib/system.lua index 04cf6a4..ac769ba 100644 --- a/lib/system.lua +++ b/lib/system.lua @@ -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