mirror of
https://github.com/bakpakin/tiny-ecs.git
synced 2026-07-22 07:56:52 -06:00
Fix some doc typos.
This commit is contained in:
@@ -91,15 +91,15 @@ end
|
|||||||
--- Marks a table conforming to the System interface as a System recognized by
|
--- Marks a table conforming to the System interface as a System recognized by
|
||||||
-- tiny-ecs. Systems are tables that contain at least one field, an update
|
-- tiny-ecs. Systems are tables that contain at least one field, an update
|
||||||
-- function that takes parameters like so:
|
-- function that takes parameters like so:
|
||||||
-- `function system:update(world, entities, dt)`. The `world` is the World the
|
-- `function system:update(world, entities, dt)`. `world` is the World the System
|
||||||
-- System belongs to, `entities` is an unordered table of Entities,
|
-- belongs to, `entities` is an unordered table of Entities with Entities as KEYS,
|
||||||
-- with Entities as the KEYS, and `dt` is the delta time. There are also a few
|
-- and `dt` is the delta time. There are also a few other optional callbacks:
|
||||||
-- other optional callbacks:
|
-- `function system:filter(entity)` - returns a boolean,
|
||||||
-- `function system:filter(entity)` - returns a boolean
|
-- `function system:onAdd(entity)` - returns nil,
|
||||||
-- `function system:onAdd(entity)` - returns nil
|
-- `function system:onRemove(entity)` - returns nil.
|
||||||
-- `function system:onRemove(entity)` - returns nil
|
|
||||||
-- For Filters, it is conveient to use `tiny.requireAll` or `tiny.requireOne`,
|
-- For Filters, it is conveient to use `tiny.requireAll` or `tiny.requireOne`,
|
||||||
-- but one can write their own filters as well.
|
-- but one can write their own filters as well.
|
||||||
|
-- @param table A table to be used as System, or `nil` to create a new System.
|
||||||
function tiny.system(table)
|
function tiny.system(table)
|
||||||
if table == nil then
|
if table == nil then
|
||||||
table = {}
|
table = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user