mirror of
https://github.com/Reuh/ubiquitousse.git
synced 2025-10-27 09:09:30 +00:00
ecs: System.filter defined using tables use all instead of any
This commit is contained in:
parent
9d2e886609
commit
027b6b9bb2
12 changed files with 16 additions and 16 deletions
|
|
@ -108,7 +108,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2021-12-26 18:43:30 </i>
|
||||
<i style="float:right;">Last updated 2021-12-27 12:20:29 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -334,7 +334,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2021-12-26 18:43:30 </i>
|
||||
<i style="float:right;">Last updated 2021-12-27 12:20:29 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -750,7 +750,7 @@ avoid repeating your filters or allow controlling several system from a single p
|
|||
Called when checking if an entity should be added to this system.
|
||||
Returns <code>true</code> if the entity should be added to this system (and therefore its subsystems).</p>
|
||||
|
||||
<p> If this is a string or a table, it will be converted to a filter function on instanciation using ecs.any.</p>
|
||||
<p> If this is a string or a table, it will be converted to a filter function on instanciation using <a href="../modules/ecs.html#all">ecs.all</a>.</p>
|
||||
|
||||
<p> If this <code>true</code>, will accept every entity; if <code>false</code>, reject every entity.</p>
|
||||
|
||||
|
|
@ -1597,7 +1597,7 @@ its sibling systems (i.e. completely stop the propagation of the event).</li>
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2021-12-26 18:43:30 </i>
|
||||
<i style="float:right;">Last updated 2021-12-27 12:20:29 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -1754,7 +1754,7 @@ end
|
|||
Level background. </p>
|
||||
|
||||
<p> If there is a background image, <code>background.image</code> contains a table <code>{image=image, x=number, y=number, sx=number, sy=number}</code>
|
||||
where <a href="../modules/ldtk.html#Tileset.image">image</a> is the LÖVE image (or image filepath if LÖVE not available) <a href="../modules/ldtk.html#Tile.x">x</a> and <a href="../modules/ldtk.html#Level.y">y</a> are the top-left position,
|
||||
where <a href="../modules/ldtk.html#Tileset.image">image</a> is the LÖVE image (or image filepath if LÖVE not available) <a href="../modules/ldtk.html#Entity.x">x</a> and <a href="../modules/ldtk.html#Tile.y">y</a> are the top-left position,
|
||||
and <a href="../modules/ldtk.html#Entity.sx">sx</a> and <a href="../modules/ldtk.html#Entity.sy">sy</a> the horizontal and vertical scale factors.
|
||||
|
||||
</ul>
|
||||
|
|
@ -1829,7 +1829,7 @@ end
|
|||
<li>Enum are converted into a Lua string giving the currently selected enum value.</li>
|
||||
<li>Filepath are converted into a Lua string giving the file path.</li>
|
||||
<li>Arrays are converted into a Lua table with the elements in it as a list.</li>
|
||||
<li>Points are converted into a Lua table with the fields <a href="../modules/ldtk.html#Tile.x">x</a> and <a href="../modules/ldtk.html#Level.y">y</a>: <code>{ x=number, y=number }</code>.</li>
|
||||
<li>Points are converted into a Lua table with the fields <a href="../modules/ldtk.html#Entity.x">x</a> and <a href="../modules/ldtk.html#Tile.y">y</a>: <code>{ x=number, y=number }</code>.</li>
|
||||
<li>Colors are converted into a Lua table with the red, green and blue components in [0-1] as a list: <code>{r,g,b}</code>.</li>
|
||||
</ul>
|
||||
|
||||
|
|
@ -1855,7 +1855,7 @@ end
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2021-12-26 18:43:30 </i>
|
||||
<i style="float:right;">Last updated 2021-12-27 12:20:29 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -702,7 +702,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2021-12-26 18:43:30 </i>
|
||||
<i style="float:right;">Last updated 2021-12-27 12:20:29 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -414,7 +414,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2021-12-26 18:43:30 </i>
|
||||
<i style="float:right;">Last updated 2021-12-27 12:20:29 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -1153,7 +1153,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2021-12-26 18:43:30 </i>
|
||||
<i style="float:right;">Last updated 2021-12-27 12:20:29 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2021-12-26 18:43:30 </i>
|
||||
<i style="float:right;">Last updated 2021-12-27 12:20:29 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -784,7 +784,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2021-12-26 18:43:30 </i>
|
||||
<i style="float:right;">Last updated 2021-12-27 12:20:29 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2021-12-26 18:43:30 </i>
|
||||
<i style="float:right;">Last updated 2021-12-27 12:20:29 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2021-12-26 18:43:30 </i>
|
||||
<i style="float:right;">Last updated 2021-12-27 12:20:29 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ let system_mt = {
|
|||
--- Called when checking if an entity should be added to this system.
|
||||
-- Returns `true` if the entity should be added to this system (and therefore its subsystems).
|
||||
--
|
||||
-- If this is a string or a table, it will be converted to a filter function on instanciation using ecs.any.
|
||||
-- If this is a string or a table, it will be converted to a filter function on instanciation using `ecs.all`.
|
||||
--
|
||||
-- If this `true`, will accept every entity; if `false`, reject every entity.
|
||||
--
|
||||
|
|
@ -735,7 +735,7 @@ let recInstanciateSystems = (world, systems)
|
|||
if type(s.filter) == "string" then
|
||||
system.filter = (_, e) return e[s.filter] ~= nil end
|
||||
elseif type(s.filter) == "table" then
|
||||
system.filter = ecs.any(unpack(s.filter))
|
||||
system.filter = ecs.all(unpack(s.filter))
|
||||
elseif type(s.filter) == "boolean" then
|
||||
if s.filter then
|
||||
system.filter = alwaysTrue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue