mirror of
https://github.com/bakpakin/tiny-ecs.git
synced 2026-07-22 07:56:52 -06:00
Update to 1.3-1
This commit is contained in:
+36
-4
@@ -81,6 +81,10 @@
|
|||||||
<td class="summary">Makes a Filter that rejects Entities with at least one of the specified
|
<td class="summary">Makes a Filter that rejects Entities with at least one of the specified
|
||||||
Components and Filters, and selects all other Entities.</td>
|
Components and Filters, and selects all other Entities.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="name" nowrap><a href="#tiny.filter">tiny.filter (pattern)</a></td>
|
||||||
|
<td class="summary">Makes a Filter from a string.</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<h2><a href="#System_functions">System functions </a></h2>
|
<h2><a href="#System_functions">System functions </a></h2>
|
||||||
<table class="function_list">
|
<table class="function_list">
|
||||||
@@ -178,7 +182,7 @@
|
|||||||
Filters take two parameters, the System and the Entity, and return a boolean
|
Filters take two parameters, the System and the Entity, and return a boolean
|
||||||
value indicating if the Entity should be processed by the System.</p>
|
value indicating if the Entity should be processed by the System.</p>
|
||||||
|
|
||||||
<p> Filters must be added to Systems by setting the <code>filter</code> field of the System.
|
<p> Filters must be added to Systems by setting the <a href="index.html#tiny.filter">filter</a> field of the System.
|
||||||
Filter's returned by tiny-ecs's Filter functions are immutable and can be
|
Filter's returned by tiny-ecs's Filter functions are immutable and can be
|
||||||
used by multiple Systems.</p>
|
used by multiple Systems.</p>
|
||||||
|
|
||||||
@@ -276,6 +280,34 @@ filter = tiny.requireAll("image", tiny.rejectAny("Player", "Enemy"))
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
<dt>
|
||||||
|
<a name = "tiny.filter"></a>
|
||||||
|
<strong>tiny.filter (pattern)</strong>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
|
||||||
|
<p>Makes a Filter from a string. Syntax of <code>pattern</code> is as follows.</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Tokens are alphanumeric strings including underscores.</li>
|
||||||
|
<li>Tokens can be separated by |, &, or surrounded by parentheses.</li>
|
||||||
|
<li>Tokens can be prefixed with !, and are then operated on with a boolean 'not'.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p> Examples are best:</p>
|
||||||
|
<pre><code>'a|b|c' - Matches entities with an 'a' component OR a 'b' component or a 'c' component.
|
||||||
|
'a&!b&c' - Matches entities with an 'a' component AND NOT a 'b' component AND a 'c' component.
|
||||||
|
'a|(b&c&d)|e - Matches 'a' OR ('b' AND 'c' AND 'd') OR 'e'
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<h2 class="section-header has-description"><a name="System_functions"></a>System functions </h2>
|
<h2 class="section-header has-description"><a name="System_functions"></a>System functions </h2>
|
||||||
@@ -576,9 +608,9 @@ end
|
|||||||
<strong>tiny.update (world, dt, filter)</strong>
|
<strong>tiny.update (world, dt, filter)</strong>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
Updates the World by dt (delta time). Takes an optional parameter, <code>filter</code>,
|
Updates the World by dt (delta time). Takes an optional parameter, <a href="index.html#tiny.filter">filter</a>,
|
||||||
which is a Filter that selects Systems from the World, and updates only those
|
which is a Filter that selects Systems from the World, and updates only those
|
||||||
Systems. If <code>filter</code> is not supplied, all Systems are updated. Put this
|
Systems. If <a href="index.html#tiny.filter">filter</a> is not supplied, all Systems are updated. Put this
|
||||||
function in your main loop.
|
function in your main loop.
|
||||||
|
|
||||||
|
|
||||||
@@ -682,7 +714,7 @@ end
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
|
||||||
<i style="float:right;">Last updated 2015-09-08 16:29:08 </i>
|
<i style="float:right;">Last updated 2016-03-05 16:37:42 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user