A feature-complete ECS library
+ +Modules
+component | +Component | +
entity | +Entity | +
init | +init | +
instance | +Instance | +
list | +List | +
pool | +Pool | +
system | +System | +
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 @@ + + + +
+component
Component
+ + + +Component.new (populate) | +Creates a new Component. | +
Component:__initialize (...) | +Creates and initializes a new Bag. | +
entity
Entity
+ + + +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. | +
init
init
+ + + +Concord.init (settings) | +Initializes the library with some optional settings | +
instance
Instance
+ + + +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. | +
list
List
+ + + +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. | +
pool
Pool
+ + + +Pool.new (name, filter) | +Creates a new Pool | +
Pool:eligible (e) | +Checks if an Entity is eligible for the Pool. | +
system
System
+ + + +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. | +