diff --git a/doc/index.html b/doc/index.html index 5452439..f491aa6 100644 --- a/doc/index.html +++ b/doc/index.html @@ -85,16 +85,20 @@
tiny.system (table, attributes) | -Creates a new System or System class. | +tiny.system (table) | +Creates a new System or System class from the supplied table. |
tiny.processingSystem (table) | Creates a new Processing System or Processing System class. | ||
tiny.getSystemEntityCount (system) | -Get number of Entities in the System. | +tiny.sortedSystem (table) | +Creates a new Sorted System or Sorted System class. | +
tiny.sortedProcessingSystem (table) | +Creates a new Sorted Processing System or Sorted Processing System class. |
Filters must be added to Systems by setting the filter
field of the System.
- Filter's returned by tiny.requireAll and tiny.requireAny are immutable
- and can be used by multiple Systems.
local f1 = tiny.requireAll("position", "velocity", "size")
local f2 = tiny.requireAny("position", "velocity", "size")
@@ -313,11 +317,17 @@ end
commonly used.
+ - The world field points to the World that the System belongs to. Useful
+ for adding and removing Entities from the world dynamically via the System.
- The
active
flag is whether or not the System is updated automatically.
Inactive Systems should be updated manually or not at all via
system:update(dt)
. Defaults to true.
- The 'entities' field is an ordered list of Entities in the System. This
list can be used to quickly iterate through all Entities in a System.
+ - The
interval
field is an optional field that makes Systems update at
+ certain intervals using buffered time, regardless of World update frequency.
+ For example, to make a System update once a second, set the System's interval
+ to 1.
- The
indices
field is a table of Entity keys to their indices in the
entities
list. Most Systems can ignore this.
- The
modified
flag is an indicator if the System has been modified in
@@ -331,38 +341,11 @@ end
-
- tiny.system (table, attributes)
+ tiny.system (table)
-
- Creates a new System or System class. An optinal list of attributes may be
- passed to specify the behavior of the System. Currently, the three supported
- attributes are
"process"
, "sorted"
, and "interval"
.
-
-
- "process"
marks the new System as a Processing System. Processing
- Systems process each entity individual, and are usually what is needed.
- Processing Systems have three extra callbacks compared to a vanilla System.
-
- function system:preProcess(entities, dt)
- Called before iterating
- over each Entity.
- function system:postProcess(entities, dt)
- Called for each Entity in
- the System.
- function system:process(entity, dt)
- Called after iteration.
- Processing Systems have their own update method, so don't implement a
- a custom update callback for Processing Systems.
-
- "sorted"
marks the new System as a Sorted System. Sorted Systems sort
- their Entities according to a user-defined method, system:compare(e1, e2)
,
- which should return true if e1
should come before e2
and false otherwise.
- "interval"
marks the new System as an Interval System. Interval
- Systems are updated regulary according to an interval rather than every time
- the world is update. This is useful for Systems that don't need to be updated
- often or need be deterministic. Interval Systems have a user-defined field
- interval
that is the time interval between updates. If no interval is
- specified, a default of 1 is used.
-
-
- If table is nil
, this function uses an empty table.
+ Creates a new System or System class from the supplied table. If table is
+ nil, creates a new table.
@@ -376,8 +359,20 @@ end
tiny.processingSystem (table)
-
- Creates a new Processing System or Processing System class. Shortcut for
-
tiny.system(table, { "process" })
.
+ Creates a new Processing System or Processing System class. Processing
+ Systems process each entity individual, and are usually what is needed.
+ Processing Systems have three extra callbacks besides those inheritted from
+ vanilla Systems.
+ * <code>function system:preProcess(entities, dt)</code> - Called before iterating
+
+ over each Entity.
+ * <code>function system:process(entities, dt)</code> - Called for each Entity in
+
+ the System.
+ * <code>function system:postProcess(entity, dt)</code> - Called after iteration.
+
+ Processing Systems have their own update method, so don't implement a
+ a custom update callback for Processing Systems.
@@ -391,16 +386,47 @@ end
-
-
- tiny.getSystemEntityCount (system)
+
+ tiny.sortedSystem (table)
-
- Get number of Entities in the System.
+ Creates a new Sorted System or Sorted System class. Sorted Systems sort
+ their Entities according to a user-defined method,
system:compare(e1, e2)
,
+ which should return true if e1
should come before e2
and false otherwise.
+ Sorted Systems also override the default System's onModify
callback, so be
+ careful if defining a custom callback. However, for processing the sorted
+ entities, consider tiny.sortedProcessingSystem(table)
.
+ See also:
+
+ system
+
+
+
+
+ -
+
+ tiny.sortedProcessingSystem (table)
+
+ -
+ Creates a new Sorted Processing System or Sorted Processing System class.
+ Sorted Processing Systems have both the aspects of Processing Systems and
+ Sorted Systems.
+
+
+
+
+
+
See also:
+
+ - system
+ - processingSystem
+ - sortedSystem
+
@@ -523,8 +549,9 @@ end
-
Updates the World by dt (delta time). Takes an optional parameter,
filter
,
- which is a Filter that selects Systems from the World. Only selected Systems
- are updated. Put this function in your main loop.
+ which is a Filter that selects Systems from the World, and updates only those
+ Systems. If filter
is not supplied, all Systems are updated. Put this
+ function in your main loop.
@@ -627,7 +654,7 @@ end
generated by LDoc 1.4.3
-Last updated 2015-06-16 23:50:18
+Last updated 2015-06-19 19:27:22