tiny-ecs
Version:
A mean lean Entity-Component-System library.
1,183 lines (371 loc) • 13.9 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Entity</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: Entity</h1>
<section>
<header>
<h2>
Entity
</h2>
</header>
<article>
<div class="container-overview">
<dt>
<h4 class="name" id="Entity"><span class="type-signature"></span>new Entity<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Basic component-driven object with facade function for interacting with the
injected EntityManager object.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Entity.js.html">Entity.js</a>, <a href="Entity.js.html#line8">line 8</a>
</li></ul></dd>
</dl>
</dd>
</div>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name" id="addComponent"><span class="type-signature"></span>addComponent<span class="signature">(TComponent)</span><span class="type-signature"> → {<a href="Entity.html">Entity</a>}</span></h4>
</dt>
<dd>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>TComponent</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Entity.js.html">Entity.js</a>, <a href="Entity.js.html#line30">line 30</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
This entity.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Entity.html">Entity</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="addTag"><span class="type-signature"></span>addTag<span class="signature">(tag)</span><span class="type-signature"> → {<a href="Entity.html">Entity</a>}</span></h4>
</dt>
<dd>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>tag</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Entity.js.html">Entity.js</a>, <a href="Entity.js.html#line84">line 84</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
This entity.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Entity.html">Entity</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="hasAllComponents"><span class="type-signature"></span>hasAllComponents<span class="signature">(Components)</span><span class="type-signature"> → {boolean}</span></h4>
</dt>
<dd>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>Components</code></td>
<td class="type">
<span class="param-type">Array.<function()></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Entity.js.html">Entity.js</a>, <a href="Entity.js.html#line59">line 59</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
True if entity has all Components.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="hasComponent"><span class="type-signature"></span>hasComponent<span class="signature">(TComponent)</span><span class="type-signature"> → {boolean}</span></h4>
</dt>
<dd>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>TComponent</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Entity.js.html">Entity.js</a>, <a href="Entity.js.html#line50">line 50</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
True if this entity has TComponent.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="hasTag"><span class="type-signature"></span>hasTag<span class="signature">(tag)</span><span class="type-signature"> → {boolean}</span></h4>
</dt>
<dd>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>tag</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Entity.js.html">Entity.js</a>, <a href="Entity.js.html#line75">line 75</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
True if entity has tag.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="remove"><span class="type-signature"></span>remove<span class="signature">()</span><span class="type-signature"> → {void}</span></h4>
</dt>
<dd>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Entity.js.html">Entity.js</a>, <a href="Entity.js.html#line103">line 103</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">void</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="removeComponent"><span class="type-signature"></span>removeComponent<span class="signature">(TComponent)</span><span class="type-signature"> → {<a href="Entity.html">Entity</a>}</span></h4>
</dt>
<dd>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>TComponent</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Entity.js.html">Entity.js</a>, <a href="Entity.js.html#line40">line 40</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
This entity.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Entity.html">Entity</a></span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="removeTag"><span class="type-signature"></span>removeTag<span class="signature">(tag)</span><span class="type-signature"> → {<a href="Entity.html">Entity</a>}</span></h4>
</dt>
<dd>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>tag</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Entity.js.html">Entity.js</a>, <a href="Entity.js.html#line94">line 94</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
This entity.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Entity.html">Entity</a></span>
</dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Entity.html">Entity</a></li><li><a href="EntityManager.html">EntityManager</a></li><li><a href="Group.html">Group</a></li><li><a href="ObjectPool.html">ObjectPool</a></li><li><a href="QuadTree.html">QuadTree</a></li><li><a href="Spatial.html">Spatial</a></li><li><a href="Vec2.html">Vec2</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha3</a> on Wed Jan 29 2014 01:06:20 GMT-0600 (CST)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>