System
Iterates over Entities. From these Entities it gets Components and modifies them.
Require
Section titled “Require”If the concord folder is in the root directory of your game, you can import this module like so:
System = require('concord.system')Creates a new SystemClass.
system = System.new( name, definition )Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
name |
string |
Name of the System. If the first argument is not a string, it is treated as the definition. |
definition |
table<string, |
FilterDefinition> A table containing filters (name = {components…}) |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
system |
SystemClass |
system = System.new( definition )Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
definition |
table<string |
FilterDefinition> A table containing filters (name = {components…}) |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
system |
SystemClass |
setEnabled
Section titled “setEnabled”Sets whether the System is enabled.
system = system:setEnabled( enable )Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
enable |
boolean |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
system |
System |
isEnabled
Section titled “isEnabled”Returns whether the System is enabled.
boolean = system:isEnabled()Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
boolean |
boolean |
getWorld
Section titled “getWorld”Returns the World the System is in.
world = system:getWorld()Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
world |
World |
Callback for system initialization.
system:init( world )Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
world |
World |
The World the System was added to |
onEnabled
Section titled “onEnabled”Callback for when a System is enabled.
system:onEnabled()onDisabled
Section titled “onDisabled”Callback for when a System is disabled.
system:onDisabled()