docs/FelFlame/Entities.html in felflame-3.0.0 vs docs/FelFlame/Entities.html in felflame-4.0.0
- old
+ new
@@ -35,11 +35,11 @@
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="../_index.html">Index (E)</a> »
- <span class='title'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span>
+ <span class='title'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span>
»
<span class="title">Entities</span>
</div>
@@ -83,18 +83,13 @@
</dl>
- <dl>
- <dt>Extended by:</dt>
- <dd>Enumerable</dd>
- </dl>
-
<dl>
@@ -107,11 +102,11 @@
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
-<p>Creates and manages Entities. Allows accessing Entities using their <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">ID</a></span>. Entities are just collections of Components.</p>
+<p>Creates and manages Entities. Entities are just collections of Components. You can use array methods directly on this class to access Entities.</p>
</div>
</div>
<div class="tags">
@@ -119,59 +114,25 @@
</div>
- <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
- <ul class="summary">
-
- <li class="public ">
- <span class="summary_signature">
-
- <a href="#id-instance_method" title="#id (instance method)">#<strong>id</strong> ⇒ Integer </a>
-
-
- </span>
-
-
-
-
- <span class="note title readonly">readonly</span>
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'>
-<p>Holds the unique ID of this entity.</p>
-</div></span>
-
-</li>
-
- </ul>
-
-
-
-
<h2>
- Class Method Summary
+ Instance Method Summary
<small><a href="#" class="summary_toggle">collapse</a></small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
- <a href="#[]-class_method" title="[] (class method)">.<strong>[]</strong>(entity_id) ⇒ Entity </a>
+ <a href="#add-instance_method" title="#add (instance method)">#<strong>add</strong>(*components_to_add) ⇒ Boolean </a>
</span>
@@ -182,20 +143,20 @@
<span class="summary_desc"><div class='inline'>
-<p>Gets an Entity from the given <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">unique ID</a></span>.</p>
+<p>Add any number components to the Entity.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
- <a href="#each-class_method" title="each (class method)">.<strong>each</strong>(&block) ⇒ Enumerator </a>
+ <a href="#component-instance_method" title="#component (instance method)">#<strong>component</strong>(manager = nil) ⇒ Component </a>
</span>
@@ -206,52 +167,19 @@
<span class="summary_desc"><div class='inline'>
-<p>Iterates over all entities.</p>
+<p>A single component from a component manager.</p>
</div></span>
</li>
- </ul>
-
- <h2>
- Instance Method Summary
- <small><a href="#" class="summary_toggle">collapse</a></small>
- </h2>
-
- <ul class="summary">
-
<li class="public ">
<span class="summary_signature">
- <a href="#add-instance_method" title="#add (instance method)">#<strong>add</strong>(*components_to_add) ⇒ Boolean </a>
-
-
-
- </span>
-
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'>
-<p>Add any number components to the Entity.</p>
-</div></span>
-
-</li>
-
-
- <li class="public ">
- <span class="summary_signature">
-
<a href="#components-instance_method" title="#components (instance method)">#<strong>components</strong> ⇒ Hash<Component_Manager, Array<Integer>> </a>
</span>
@@ -263,11 +191,11 @@
<span class="summary_desc"><div class='inline'>
-<p>A hash that uses component manager constant names as keys, and where the values of those keys are arrays that contain the <span class='object_link'><a href="ComponentManager.html#id-instance_method" title="FelFlame::ComponentManager#id (method)">IDs</a></span> of the components attached to this entity.</p>
+<p>A hash that uses component manager constant names as keys, and where the values of those keys are arrays that contain the the components attached to this entity.</p>
</div></span>
</li>
@@ -287,11 +215,11 @@
<span class="summary_desc"><div class='inline'>
-<p>Removes this Entity from the list and purges all references to this Entity from other Components, as well as its <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">ID</a></span> and data.</p>
+<p>Removes this Entity from the list and purges all references to this Entity from other Components, as well as its data.</p>
</div></span>
</li>
@@ -343,39 +271,14 @@
</div></span>
</li>
- <li class="public ">
- <span class="summary_signature">
-
- <a href="#to_i-instance_method" title="#to_i (instance method)">#<strong>to_i</strong> ⇒ Integer </a>
-
-
-
- </span>
-
-
-
-
-
-
-
-
-
- <span class="summary_desc"><div class='inline'>
-<p>An alias for the <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">ID reader</a></span>.</p>
-</div></span>
-
-</li>
-
-
</ul>
-
- <div id="constructor_details" class="method_details_list">
+<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">
@@ -400,11 +303,11 @@
<li>
<span class='name'>components</span>
- <span class='type'>(<tt><span class='object_link'><a href="Components.html" title="FelFlame::Components (class)">Components</a></span></tt>)</span>
+ <span class='type'>(<tt><span class='object_link'><a href="Components.html" title="FelFlame::Components (module)">Components</a></span></tt>)</span>
—
<div class='inline'>
@@ -420,165 +323,88 @@
<tr>
<td>
<pre class="lines">
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26</pre>
+8
+9
+10
+11
+12</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 16</span>
+ <pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 8</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_components'>components</span><span class='rparen'>)</span>
- <span class='comment'># Assign new unique ID
-</span> <span class='id identifier rubyid_new_id'>new_id</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_find_index'>find_index</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:nil?</span><span class='rparen'>)</span>
- <span class='id identifier rubyid_new_id'>new_id</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_id'>new_id</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
- <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='id identifier rubyid_new_id'>new_id</span>
-
<span class='comment'># Add each component
</span> <span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_components'>components</span><span class='rparen'>)</span>
-
- <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_id'>id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>self</span>
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid__data'>_data</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='kw'>self</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
- <div id="instance_attr_details" class="attr_details">
- <h2>Instance Attribute Details</h2>
-
-
- <span id="id=-instance_method"></span>
- <div class="method_details first">
- <h3 class="signature first" id="id-instance_method">
-
- #<strong>id</strong> ⇒ <tt>Integer</tt>
-
-
+ <div id="instance_method_details" class="method_details_list">
+ <h2>Instance Method Details</h2>
-
-</h3><div class="docstring">
- <div class="discussion">
-<p>Holds the unique ID of this entity</p>
-
-
- </div>
-</div>
-<div class="tags">
-
-<p class="tag_title">Returns:</p>
-<ul class="return">
-
- <li>
-
-
- <span class='type'>(<tt>Integer</tt>)</span>
-
-
-
- </li>
-
-</ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-5
-6
-7</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 5</span>
-
-<span class='kw'>def</span> <span class='id identifier rubyid_id'>id</span>
- <span class='ivar'>@id</span>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
-
- </div>
-
-
- <div id="class_method_details" class="method_details_list">
- <h2>Class Method Details</h2>
-
-
<div class="method_details first">
- <h3 class="signature first" id="[]-class_method">
+ <h3 class="signature first" id="add-instance_method">
- .<strong>[]</strong>(entity_id) ⇒ <tt>Entity</tt>
+ #<strong>add</strong>(*components_to_add) ⇒ <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
-<p>Gets an Entity from the given <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">unique ID</a></span>. Usage is simular to how an Array lookup works</p>
+<p>Add any number components to the Entity.</p>
</div>
</div>
<div class="tags">
-
- <div class="examples">
- <p class="tag_title">Examples:</p>
-
-
- <pre class="example code"><code><span class='comment'># This gets the Entity with ID 7
-</span><span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Entities (class)">Entities</a></span></span><span class='lbracket'>[</span><span class='int'>7</span><span class='rbracket'>]</span></code></pre>
-
- </div>
-<p class="tag_title">Parameters:</p>
+ <p class="tag_title">Parameters:</p>
<ul class="param">
<li>
- <span class='name'>entity_id</span>
+ <span class='name'>components_to_add</span>
- <span class='type'>(<tt>Integer</tt>)</span>
+ <span class='type'>(<tt>Component</tt>)</span>
+ —
+ <div class='inline'>
+<p>Any number of components created from any component manager</p>
+</div>
+
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
- <span class='type'>(<tt>Entity</tt>)</span>
+ <span class='type'>(<tt>Boolean</tt>)</span>
—
<div class='inline'>
-<p>returns the Entity that uses the given unique ID, nil if there is no Entity associated with the given ID</p>
+<p><code>true</code></p>
</div>
</li>
</ul>
@@ -587,118 +413,91 @@
<tr>
<td>
<pre class="lines">
-116
-117
-118</pre>
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 116</span>
+ <pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 57</span>
-<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span>
- <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rbracket'>]</span>
+<span class='kw'>def</span> <span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_components_to_add'>components_to_add</span><span class='rparen'>)</span>
+ <span class='id identifier rubyid_components_to_add'>components_to_add</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span>
+ <span class='kw'>if</span> <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
+ <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='rbracket'>]</span>
+ <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='kw'>self</span>
+ <span class='id identifier rubyid_check_systems'>check_systems</span> <span class='id identifier rubyid_component'>component</span><span class='comma'>,</span> <span class='symbol'>:addition_triggers</span>
+ <span class='kw'>elsif</span> <span class='op'>!</span><span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_component'>component</span>
+ <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_component'>component</span>
+ <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='kw'>self</span>
+ <span class='id identifier rubyid_check_systems'>check_systems</span> <span class='id identifier rubyid_component'>component</span><span class='comma'>,</span> <span class='symbol'>:addition_triggers</span>
+ <span class='kw'>end</span>
+ <span class='kw'>end</span>
+ <span class='kw'>true</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
- <h3 class="signature " id="each-class_method">
+ <h3 class="signature " id="component-instance_method">
- .<strong>each</strong>(&block) ⇒ <tt>Enumerator</tt>
+ #<strong>component</strong>(manager = nil) ⇒ <tt>Component</tt>
</h3><div class="docstring">
<div class="discussion">
-<p>Iterates over all entities. The data is compacted so that means index does not correlate to ID. You also call other enumerable methods instead of each, such as <code>each_with_index</code> or <code>select</code></p>
+<p>A single component from a component manager. Use this if you expect the component to only belong to one entity and you want to access it. Access the component using either parameter notation or array notation. Array notation is conventional for better readablility.</p>
</div>
</div>
<div class="tags">
-<p class="tag_title">Returns:</p>
-<ul class="return">
-
- <li>
+ <div class="examples">
+ <p class="tag_title">Examples:</p>
+
-
- <span class='type'>(<tt>Enumerator</tt>)</span>
-
-
-
- </li>
-
-</ul>
-
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-123
-124
-125</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 123</span>
-
-<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
- <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
-</div>
+ <pre class="example code"><code><span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_component'>component</span><span class='lbracket'>[</span><span class='ivar'>@component_manager</span><span class='rbracket'>]</span> <span class='comment'># array notation(the standard)
+</span><span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_component'>component</span><span class='lparen'>(</span><span class='ivar'>@component_manager</span><span class='rparen'>)</span> <span class='comment'># method notation</span></code></pre>
</div>
-
- <div id="instance_method_details" class="method_details_list">
- <h2>Instance Method Details</h2>
-
-
- <div class="method_details first">
- <h3 class="signature first" id="add-instance_method">
-
- #<strong>add</strong>(*components_to_add) ⇒ <tt>Boolean</tt>
-
-
-
-
-
-</h3><div class="docstring">
- <div class="discussion">
-
-<p>Add any number components to the Entity.</p>
-
-
- </div>
-</div>
-<div class="tags">
- <p class="tag_title">Parameters:</p>
+<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
- <span class='name'>components_to_add</span>
+ <span class='name'>manager</span>
- <span class='type'>(<tt>Component</tt>)</span>
+ <span class='type'>(<tt><span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span></tt>)</span>
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
+
—
<div class='inline'>
-<p>Any number of components created from any component manager</p>
+<p>If you pass nil you can then use array notation to access the same value.</p>
</div>
</li>
</ul>
@@ -707,60 +506,55 @@
<ul class="return">
<li>
- <span class='type'>(<tt>Boolean</tt>)</span>
+ <span class='type'>(<tt>Component</tt>)</span>
- —
- <div class='inline'>
-<p><code>true</code></p>
-</div>
-
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70</pre>
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 57</span>
+ <pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 26</span>
-<span class='kw'>def</span> <span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_components_to_add'>components_to_add</span><span class='rparen'>)</span>
- <span class='id identifier rubyid_components_to_add'>components_to_add</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span>
- <span class='kw'>if</span> <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
- <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='rbracket'>]</span>
- <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='kw'>self</span>
- <span class='id identifier rubyid_check_systems'>check_systems</span> <span class='id identifier rubyid_component'>component</span><span class='comma'>,</span> <span class='symbol'>:addition_triggers</span>
- <span class='kw'>elsif</span> <span class='op'>!</span><span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_component'>component</span>
- <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_component'>component</span>
- <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='kw'>self</span>
- <span class='id identifier rubyid_check_systems'>check_systems</span> <span class='id identifier rubyid_component'>component</span><span class='comma'>,</span> <span class='symbol'>:addition_triggers</span>
+<span class='kw'>def</span> <span class='id identifier rubyid_component'>component</span><span class='lparen'>(</span><span class='id identifier rubyid_manager'>manager</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
+ <span class='kw'>if</span> <span class='id identifier rubyid_manager'>manager</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
+ <span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Entities (class)">Entities</a></span></span><span class='period'>.</span><span class='id identifier rubyid_component_redirect'>component_redirect</span><span class='period'>.</span><span class='id identifier rubyid_entity'>entity</span> <span class='op'>=</span> <span class='kw'>self</span>
+ <span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Entities (class)">Entities</a></span></span><span class='period'>.</span><span class='id identifier rubyid_component_redirect'>component_redirect</span>
+ <span class='kw'>else</span>
+ <span class='kw'>if</span> <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_manager'>manager</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>This entity(</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='embexpr_end'>}</span><span class='tstring_content'>) doesnt have any components of this type: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_manager'>manager</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_manager'>manager</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>></span> <span class='int'>1</span>
+ <span class='const'>Warning</span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>This entity has MANY of this component but you called the method that is intended for having a single of this component type.\nYou may have a bug in your logic.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
+
+ <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_manager'>manager</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
<span class='kw'>end</span>
- <span class='kw'>true</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
@@ -775,11 +569,11 @@
</h3><div class="docstring">
<div class="discussion">
-<p>A hash that uses component manager constant names as keys, and where the values of those keys are arrays that contain the <span class='object_link'><a href="ComponentManager.html#id-instance_method" title="FelFlame::ComponentManager#id (method)">IDs</a></span> of the components attached to this entity.</p>
+<p>A hash that uses component manager constant names as keys, and where the values of those keys are arrays that contain the the components attached to this entity.</p>
</div>
</div>
<div class="tags">
@@ -802,16 +596,16 @@
<tr>
<td>
<pre class="lines">
-30
-31
-32</pre>
+16
+17
+18</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 30</span>
+ <pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 16</span>
<span class='kw'>def</span> <span class='id identifier rubyid_components'>components</span>
<span class='ivar'>@components</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
<span class='kw'>end</span></pre>
</td>
@@ -829,11 +623,11 @@
</h3><div class="docstring">
<div class="discussion">
-<p>Removes this Entity from the list and purges all references to this Entity from other Components, as well as its <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">ID</a></span> and data.</p>
+<p>Removes this Entity from the list and purges all references to this Entity from other Components, as well as its data.</p>
</div>
</div>
<div class="tags">
@@ -861,11 +655,10 @@
<tr>
<td>
<pre class="lines">
-42
43
44
45
46
47
@@ -874,21 +667,20 @@
50
51
52</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 42</span>
+ <pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 43</span>
<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
- <span class='id identifier rubyid_components'>components</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component_manager'>component_manager</span><span class='comma'>,</span> <span class='id identifier rubyid_component_array'>component_array</span><span class='op'>|</span>
- <span class='id identifier rubyid_component_array'>component_array</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span>
+ <span class='id identifier rubyid_components'>components</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid__component_manager'>_component_manager</span><span class='comma'>,</span> <span class='id identifier rubyid_component_array'>component_array</span><span class='op'>|</span>
+ <span class='id identifier rubyid_component_array'>component_array</span><span class='period'>.</span><span class='id identifier rubyid_reverse_each'>reverse_each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span>
<span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
- <span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Entities (class)">Entities</a></span></span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_id'>id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>nil</span>
+ <span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Entities (class)">Entities</a></span></span><span class='period'>.</span><span class='id identifier rubyid__data'>_data</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='kw'>self</span>
<span class='ivar'>@components</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
- <span class='ivar'>@id</span> <span class='op'>=</span> <span class='kw'>nil</span>
<span class='kw'>true</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
@@ -963,87 +755,35 @@
89
90
91
92
93
-94</pre>
+94
+95</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 87</span>
<span class='kw'>def</span> <span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_components_to_remove'>components_to_remove</span><span class='rparen'>)</span>
<span class='id identifier rubyid_components_to_remove'>components_to_remove</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span>
<span class='id identifier rubyid_check_systems'>check_systems</span> <span class='id identifier rubyid_component'>component</span><span class='comma'>,</span> <span class='symbol'>:removal_triggers</span> <span class='kw'>if</span> <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='kw'>self</span>
<span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='kw'>self</span>
<span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_component'>component</span>
+ <span class='id identifier rubyid_components'>components</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='kw'>if</span> <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='kw'>end</span>
<span class='kw'>true</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
- <div class="method_details ">
- <h3 class="signature " id="to_i-instance_method">
-
- #<strong>to_i</strong> ⇒ <tt>Integer</tt>
-
-
-
-
-
-</h3><div class="docstring">
- <div class="discussion">
-
-<p>An alias for the <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">ID reader</a></span></p>
-
-
</div>
-</div>
-<div class="tags">
-
-<p class="tag_title">Returns:</p>
-<ul class="return">
-
- <li>
-
-
- <span class='type'>(<tt>Integer</tt>)</span>
-
-
-
- </li>
-
-</ul>
-</div><table class="source_code">
- <tr>
- <td>
- <pre class="lines">
-
-
-36
-37
-38</pre>
- </td>
- <td>
- <pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 36</span>
-
-<span class='kw'>def</span> <span class='id identifier rubyid_to_i'>to_i</span>
- <span class='id identifier rubyid_id'>id</span>
-<span class='kw'>end</span></pre>
- </td>
- </tr>
-</table>
</div>
-
- </div>
-</div>
-
<div id="footer">
- Generated on Mon Jul 12 18:28:27 2021 by
+ Generated on Mon Jan 3 08:23:04 2022 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-2.7.3).
</div>
</div>
\ No newline at end of file