|
1 | 1 | <!DOCTYPE html> |
2 | | -<html lang="en"><head><meta charset="utf-8"/><link href="../bootstrap-combined.min.css" rel="stylesheet" /><script type="text/javascript" src="../jquery-1.9.1.min.js"></script><script type="text/javascript" src="../bootstrap.min.js"></script><link href="../styles.css" rel="stylesheet" /><link rel="icon" href="../favicon.ico" type="image/x-icon"></link><script type="text/javascript" src="../nav.js"></script><script type="text/javascript" src="../index.js"></script><script type="text/javascript">var dox = {rootPath: "../",platforms: ["dox"]};</script><title>ComponentSet - Flaxen API 13-May-15</title></head><body><div class="navbar navbar-inverse navbar-fixed-top"><div class="navbar-inner"><form class="navbar-search pull-left" id="searchForm"><input id="search" type="text" class="search-query" placeholder="Filter" autocomplete="off"/></form><ul class="nav"><li id="select-platform" class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Platform<b class="caret"></b></a><ul class="dropdown-menu"><li data="all"><a href="#">All Platforms</a></li><li data="dox"><a href="#">dox</a></li></ul></li></ul></div></div><div id="container"><div id="nav"></div><div id="content"><div class="header"><span class="viewsource"><a href="https://github.com/scriptorum/flaxen/blob/master/source/flaxen/ComponentSet.hx">View source</a></span><h1><code><span class="directive">class </span><span class="type">flaxen.ComponentSet</span></code></h1></div><div class="body"><p class="availability">Available on all platforms</p><div class="doc"><p>A ComponentSet is a list of steps that can be added (installed) into an entity |
| 2 | +<html lang="en"><head><meta charset="utf-8"/><link href="../bootstrap-combined.min.css" rel="stylesheet" /><script type="text/javascript" src="../jquery-1.9.1.min.js"></script><script type="text/javascript" src="../bootstrap.min.js"></script><link href="../styles.css" rel="stylesheet" /><link rel="icon" href="../favicon.ico" type="image/x-icon"></link><script type="text/javascript" src="../nav.js"></script><script type="text/javascript" src="../index.js"></script><script type="text/javascript">var dox = {rootPath: "../",platforms: ["dox"]};</script><title>ComponentSet - Flaxen API 16-Aug-15</title></head><body><div class="navbar navbar-inverse navbar-fixed-top"><div class="navbar-inner"><form class="navbar-search pull-left" id="searchForm"><input id="search" type="text" class="search-query" placeholder="Filter" autocomplete="off"/></form><ul class="nav"><li id="select-platform" class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Platform<b class="caret"></b></a><ul class="dropdown-menu"><li data="all"><a href="#">All Platforms</a></li><li data="dox"><a href="#">dox</a></li></ul></li></ul></div></div><div id="container"><div id="nav"></div><div id="content"><div class="header"><span class="viewsource"><a href="https://github.com/scriptorum/flaxen/blob/master/source/flaxen/ComponentSet.hx">View source</a></span><h1><code><span class="directive">class </span><span class="type">flaxen.ComponentSet</span></code></h1></div><div class="body"><p class="availability">Available on all platforms</p><div class="doc"><p>A ComponentSet is a list of steps that can be added (installed) into an entity |
3 | 3 | (or ideally more). Most steps are for adding instances of components. This is its |
4 | 4 | primary function, to quickly add components to an entity. Steps can also be used |
5 | 5 | to remove components from entities, or execute arbitrary functions that may or may |
|
12 | 12 | .addClass(Position, [0, 0]) |
13 | 13 | .remove(Animation); |
14 | 14 | flaxen.addSet(entity1, "base"); |
15 | | - flaxen.addSet(entity2, "base");</code></pre></div><h2>Instance Fields</h2><div class="platform platform-dox"><a name="new"></a><h3><p><code><span class="keyword">function</span> <a href="#new"><span class="identifier">new</span></a>():<span class="type">Void</span></code></p></h3><div class="doc"><p></p></div></div><div class="platform platform-dox"><a name="add"></a><h3><p><code><span class="keyword">function</span> <a href="#add"><span class="identifier">add</span></a><<span class="type">T</span>>(component:<span class="type">T</span>):<a class="type" href="../flaxen/ComponentSet.html">ComponentSet</a></code></p></h3><div class="doc"><p>Adds a component instance to the component set. Note that all entities using this set |
| 15 | + flaxen.addSet(entity2, "base");</code></pre></div><h2>Instance Fields</h2><div class="platform platform-dox"><a name="new"></a><h3><p><code><span class="keyword">function</span> <a href="#new"><span class="identifier">new</span></a>():<span class="type">Void</span></code></p></h3><div class="doc"><p></p></div></div><div class="platform platform-dox"><a name="add"></a><h3><p><code><span class="keyword">function</span> <a href="#add"><span class="identifier">add</span></a>(component:<span class="type">Dynamic</span>):<a class="type" href="../flaxen/ComponentSet.html">ComponentSet</a></code></p></h3><div class="doc"><p>Adds a component instance to the component set. Note that all entities using this set |
16 | 16 | will be sharing the same single instance of this component. See addClass. |
17 | | -TODO Verify this is not a Class or Function being passed in.</p></div></div><div class="platform platform-dox"><a name="addClass"></a><h3><p><code><span class="keyword">function</span> <a href="#addClass"><span class="identifier">addClass</span></a>(clazz:<span class="type">Class</span><<span class="type">Dynamic</span>>, ?args:<span class="type">Array</span><<span class="type">Dynamic</span>> = null):<a class="type" href="../flaxen/ComponentSet.html">ComponentSet</a></code></p></h3><div class="doc"><p>Adds a class and parameters to the set. The class will be instantiated with the |
| 17 | +TODO Verify this is not a Class or Function being passed in.</p></div></div><div class="platform platform-dox"><a name="addClass"></a><h3><p><code><span class="keyword">function</span> <a href="#addClass"><span class="identifier">addClass</span></a>(clazz:<span class="type">Class</span><<span class="type">Dynamic</span>>, ?args:<span class="type">Array</span><<span class="type">Dynamic</span>>):<a class="type" href="../flaxen/ComponentSet.html">ComponentSet</a></code></p></h3><div class="doc"><p>Adds a class and parameters to the set. The class will be instantiated with the |
18 | 18 | supplied paramters every time the set is installed in an entity. This prevents |
19 | 19 | sharing of instances that happens when you call set.add(new MyComponent(A, B, C)). |
20 | 20 | For example: set.addClass(MyComponent, [A, B, C]);</p></div></div><div class="platform platform-dox"><a name="addEntity"></a><h3><p><code><span class="keyword">function</span> <a href="#addEntity"><span class="identifier">addEntity</span></a>(entity:<span class="type">Entity</span>):<a class="type" href="../flaxen/ComponentSet.html">ComponentSet</a></code></p></h3><div class="doc"><p>Adds all the components from one entity into the set. Note that these components |
|
30 | 30 | entity, or instead add the WeaponSet to the GunSet using this method. Then when |
31 | 31 | install GunSet, the entity will also get WeaponSet installed.</p></div></div><div class="platform platform-dox"><a name="install"></a><h3><p><code><span class="keyword">function</span> <a href="#install"><span class="identifier">install</span></a>(entity:<span class="type">Entity</span>):<span class="type">Void</span></code></p></h3><div class="doc"><p>Installs the components into the entity</p></div></div><div class="platform platform-dox"><a name="remove"></a><h3><p><code><span class="keyword">function</span> <a href="#remove"><span class="identifier">remove</span></a>(clazz:<span class="type">Class</span><<span class="type">Dynamic</span>>):<a class="type" href="../flaxen/ComponentSet.html">ComponentSet</a></code></p></h3><div class="doc"><p>\* |
32 | 32 | Does not add an instance. Instead, when installed, removes the supplied |
33 | | -component from the entity, if it has one.</p></div></div><div class="platform platform-dox"><a name="removeAll"></a><h3><p><code><span class="keyword">function</span> <a href="#removeAll"><span class="identifier">removeAll</span></a>(?except:<span class="type">Array</span><<span class="type">Class</span><<span class="type">Dynamic</span>>> = null):<a class="type" href="../flaxen/ComponentSet.html">ComponentSet</a></code></p></h3><div class="doc"><p>Does not add an instance. Instead, when installed, removes all components |
| 33 | +component from the entity, if it has one.</p></div></div><div class="platform platform-dox"><a name="removeAll"></a><h3><p><code><span class="keyword">function</span> <a href="#removeAll"><span class="identifier">removeAll</span></a>(?except:<span class="type">Array</span><<span class="type">Class</span><<span class="type">Dynamic</span>>>):<a class="type" href="../flaxen/ComponentSet.html">ComponentSet</a></code></p></h3><div class="doc"><p>Does not add an instance. Instead, when installed, removes all components |
34 | 34 | from an entity. Completely blanks out an entity. Do this before any add calls. |
35 | 35 | If an array of component classes is supplied, these components will be |
36 | 36 | spared removal</p></div></div><div class="platform platform-dox"><a name="toString"></a><h3><p><code><span class="keyword">function</span> <a href="#toString"><span class="identifier">toString</span></a>():<span class="type">String</span></code></p></h3><div class="doc"><p>TODO This reports "[func]" if it encounters a remove or removeAll. This |
|
0 commit comments