summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2022-01-03 08:25:17 -0500
committerrealtradam <[email protected]>2022-01-03 08:25:17 -0500
commitef9d4d0dcdebbd5ed314cb874e373031cae08438 (patch)
treeee70c5357d5969caaed08446c32746e656b223e6
parentaad51d646812804052ce2ae5e926b667b4e24d6d (diff)
downloadFelECS-system.tar.gz
FelECS-system.zip
-rw-r--r--Gemfile.lock2
-rw-r--r--docs/FelFlame.html2
-rw-r--r--docs/FelFlame/ComponentManager.html2
-rw-r--r--docs/FelFlame/Components.html2
-rw-r--r--docs/FelFlame/Entities.html2
-rw-r--r--docs/FelFlame/Order.html12
-rw-r--r--docs/FelFlame/Scenes.html2
-rw-r--r--docs/FelFlame/Stage.html2
-rw-r--r--docs/FelFlame/Systems.html2
-rw-r--r--docs/Felflame_.html4
-rw-r--r--docs/_index.html2
-rw-r--r--docs/file.README.html38
-rw-r--r--docs/index.html38
-rw-r--r--docs/top-level-namespace.html2
-rw-r--r--lib/felflame/order.rb7
-rw-r--r--lib/felflame/version.rb2
-rw-r--r--spec/order_spec.rb2
17 files changed, 94 insertions, 29 deletions
diff --git a/Gemfile.lock b/Gemfile.lock
index c25006c..7b5b5fe 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- felflame (3.0.0)
+ felflame (4.0.0)
GEM
remote: https://rubygems.org/
diff --git a/docs/FelFlame.html b/docs/FelFlame.html
index 0320860..439094e 100644
--- a/docs/FelFlame.html
+++ b/docs/FelFlame.html
@@ -309,7 +309,7 @@
</div>
<div id="footer">
- Generated on Mon Jan 3 08:08:08 2022 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>
diff --git a/docs/FelFlame/ComponentManager.html b/docs/FelFlame/ComponentManager.html
index a29ad10..19891af 100644
--- a/docs/FelFlame/ComponentManager.html
+++ b/docs/FelFlame/ComponentManager.html
@@ -1229,7 +1229,7 @@
</div>
<div id="footer">
- Generated on Mon Jan 3 08:08:08 2022 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>
diff --git a/docs/FelFlame/Components.html b/docs/FelFlame/Components.html
index 43a84f0..be924da 100644
--- a/docs/FelFlame/Components.html
+++ b/docs/FelFlame/Components.html
@@ -323,7 +323,7 @@
</div>
<div id="footer">
- Generated on Mon Jan 3 08:08:08 2022 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>
diff --git a/docs/FelFlame/Entities.html b/docs/FelFlame/Entities.html
index f7ae79a..37a9d84 100644
--- a/docs/FelFlame/Entities.html
+++ b/docs/FelFlame/Entities.html
@@ -782,7 +782,7 @@
</div>
<div id="footer">
- Generated on Mon Jan 3 08:08:08 2022 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>
diff --git a/docs/FelFlame/Order.html b/docs/FelFlame/Order.html
index e55ce58..832e16f 100644
--- a/docs/FelFlame/Order.html
+++ b/docs/FelFlame/Order.html
@@ -129,7 +129,7 @@
<span class="summary_desc"><div class='inline'>
-<p>Sets the priority of all items passed into this method according to the order they were passed.</p>
+<p>Sets the priority of all items passed into this method according to the order they were passed.</p>
</div></span>
</li>
@@ -156,7 +156,7 @@
</h3><div class="docstring">
<div class="discussion">
-<p>Sets the priority of all items passed into this method according to the order they were passed. If an array is one of the elements then it will give all of those elements in the array the same priority.</p>
+<p>Sets the priority of all items passed into this method according to the order they were passed. If an array is one of the elements then it will give all of those elements in the array the same priority.</p>
</div>
@@ -203,7 +203,6 @@
<pre class="lines">
-10
11
12
13
@@ -214,10 +213,11 @@
18
19
20
-21</pre>
+21
+22</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/felflame/order.rb', line 10</span>
+ <pre class="code"><span class="info file"># File 'lib/felflame/order.rb', line 11</span>
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_sortables'>sortables</span><span class='rparen'>)</span>
<span class='id identifier rubyid_sortables'>sortables</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_sorted'>sorted</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='op'>|</span>
@@ -241,7 +241,7 @@
</div>
<div id="footer">
- Generated on Mon Jan 3 08:08:08 2022 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>
diff --git a/docs/FelFlame/Scenes.html b/docs/FelFlame/Scenes.html
index fd224e6..68f4ece 100644
--- a/docs/FelFlame/Scenes.html
+++ b/docs/FelFlame/Scenes.html
@@ -755,7 +755,7 @@
</div>
<div id="footer">
- Generated on Mon Jan 3 08:08:08 2022 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>
diff --git a/docs/FelFlame/Stage.html b/docs/FelFlame/Stage.html
index 2acb4cb..7dd9b26 100644
--- a/docs/FelFlame/Stage.html
+++ b/docs/FelFlame/Stage.html
@@ -562,7 +562,7 @@
</div>
<div id="footer">
- Generated on Mon Jan 3 08:08:08 2022 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>
diff --git a/docs/FelFlame/Systems.html b/docs/FelFlame/Systems.html
index 4fe103e..d2fb24f 100644
--- a/docs/FelFlame/Systems.html
+++ b/docs/FelFlame/Systems.html
@@ -1495,7 +1495,7 @@
</div>
<div id="footer">
- Generated on Mon Jan 3 08:08:08 2022 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>
diff --git a/docs/Felflame_.html b/docs/Felflame_.html
index ee0ed1d..c748359 100644
--- a/docs/Felflame_.html
+++ b/docs/Felflame_.html
@@ -117,7 +117,7 @@
</div>
</dt>
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>3.0.0</span><span class='tstring_end'>&#39;</span></span></pre></dd>
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>4.0.0</span><span class='tstring_end'>&#39;</span></span></pre></dd>
</dl>
@@ -133,7 +133,7 @@
</div>
<div id="footer">
- Generated on Mon Jan 3 08:08:08 2022 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>
diff --git a/docs/_index.html b/docs/_index.html
index e2c0548..3a4b9fb 100644
--- a/docs/_index.html
+++ b/docs/_index.html
@@ -183,7 +183,7 @@
</div>
<div id="footer">
- Generated on Mon Jan 3 08:08:07 2022 by
+ Generated on Mon Jan 3 08:23:03 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>
diff --git a/docs/file.README.html b/docs/file.README.html
index e075115..f62e0db 100644
--- a/docs/file.README.html
+++ b/docs/file.README.html
@@ -80,7 +80,8 @@
* <a href="#entities">Entities</a>
* <a href="#systems">Systems</a>
* <a href="#scenes">Scenes</a>
- * <a href="#stage">Stage</a></li>
+ * <a href="#stage">Stage</a>
+ * <a href="#order">Order</a></li>
<li><a href="#usage">Usage</a>
<ul>
@@ -129,6 +130,11 @@
<li><a href="#removing-scenes">Removing Scenes</a></li>
<li><a href="#executing">Executing</a></li>
</ul></li>
+<li><a href="#order-1">Order</a>
+
+<ul>
+<li><a href="#setting-the-order">Setting the order</a></li>
+</ul></li>
<li><a href="#closing-notes">Closing Notes</a></li>
</ul></li>
<li><a href="#contribution">Contribution</a></li>
@@ -169,7 +175,7 @@ ECS stands for Entity, Component, and System.</p>
<p>By using this pattern it allows programmers to easily control what an &quot;object&quot; or entity can do and how much data it needs to have. It avoids the issue of inhertance as no inhertance is ever required in this system. If you need a certain entity to have a certain functionality you just add the relevant component to it, and the systems that automatically go over specific components will give your entitiy the desired functionality. </p>
-<p><strong>&quot;But your framework also has <code>Scenes</code> and a <code>Stage</code>, what is that about?&quot;</strong> </p>
+<p><strong>&quot;But your framework also has <code>Scenes</code>, <code>Stage</code>, and <code>Order</code>, what is that about?&quot;</strong> </p>
<hr>
@@ -181,6 +187,10 @@ ECS stands for Entity, Component, and System.</p>
<p>The Stage is Scenes which are activated. This means any Scenes on the Stage are executed each frame, while the rest of the Systems are not.</p>
+<h3 id="order">Order</h3>
+
+<p>Order is a helper class which can set the priority of Scenes and Systems.</p>
+
<hr>
<h1 id="usage">Usage</h1>
@@ -504,6 +514,28 @@ E.g priority 1 will go first, priority 2 will go second, etcetera. </p>
<pre class="code ruby"><code class="ruby"><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="FelFlame/Stage.html" title="FelFlame::Stage (module)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_call'><span class='object_link'><a href="FelFlame/Stage.html#call-class_method" title="FelFlame::Stage.call (method)">call</a></span></span>
</code></pre>
+<h2 id="order">Order</h2>
+
+<h3 id="setting-the-order">Setting the order</h3>
+
+<p>To set the order you just need to call <code>FelFlame::Order.sort</code> and pass Scenes or Systems in the parameters in the order you wish for them to execute</p>
+
+<pre class="code ruby"><code class="ruby"><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="FelFlame/Order.html" title="FelFlame::Order (module)">Order</a></span></span><span class='period'>.</span><span class='id identifier rubyid_sort'><span class='object_link'><a href="FelFlame/Order.html#sort-class_method" title="FelFlame::Order.sort (method)">sort</a></span></span><span class='lparen'>(</span>
+ <span class='ivar'>@system1</span><span class='comma'>,</span>
+ <span class='ivar'>@system2</span><span class='comma'>,</span>
+ <span class='ivar'>@system3</span>
+<span class='rparen'>)</span>
+</code></pre>
+
+<p>If you want some Scenes or Systems to have the same priority then just pass them as an array:</p>
+
+<pre class="code ruby"><code class="ruby"><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="FelFlame/Order.html" title="FelFlame::Order (module)">Order</a></span></span><span class='period'>.</span><span class='id identifier rubyid_sort'><span class='object_link'><a href="FelFlame/Order.html#sort-class_method" title="FelFlame::Order.sort (method)">sort</a></span></span><span class='lparen'>(</span>
+ <span class='ivar'>@scene1</span><span class='comma'>,</span>
+ <span class='lbracket'>[</span><span class='ivar'>@scene2_1</span><span class='comma'>,</span> <span class='ivar'>@scene2_2</span><span class='rbracket'>]</span><span class='comma'>,</span>
+ <span class='ivar'>@scene3</span>
+<span class='rparen'>)</span>
+</code></pre>
+
<h2 id="closing-notes">Closing Notes</h2>
<p>There are some methods I haven&#39;t gone over in the overview. If you want to see everything and read in more detail check out the <a href="https://felflame.tradam.fyi">Documentation</a>!</p>
@@ -518,7 +550,7 @@ E.g priority 1 will go first, priority 2 will go second, etcetera. </p>
</div></div>
<div id="footer">
- Generated on Mon Jan 3 08:08:08 2022 by
+ Generated on Mon Jan 3 08:23:03 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>
diff --git a/docs/index.html b/docs/index.html
index 38b9106..83af15a 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -80,7 +80,8 @@
* <a href="#entities">Entities</a>
* <a href="#systems">Systems</a>
* <a href="#scenes">Scenes</a>
- * <a href="#stage">Stage</a></li>
+ * <a href="#stage">Stage</a>
+ * <a href="#order">Order</a></li>
<li><a href="#usage">Usage</a>
<ul>
@@ -129,6 +130,11 @@
<li><a href="#removing-scenes">Removing Scenes</a></li>
<li><a href="#executing">Executing</a></li>
</ul></li>
+<li><a href="#order-1">Order</a>
+
+<ul>
+<li><a href="#setting-the-order">Setting the order</a></li>
+</ul></li>
<li><a href="#closing-notes">Closing Notes</a></li>
</ul></li>
<li><a href="#contribution">Contribution</a></li>
@@ -169,7 +175,7 @@ ECS stands for Entity, Component, and System.</p>
<p>By using this pattern it allows programmers to easily control what an &quot;object&quot; or entity can do and how much data it needs to have. It avoids the issue of inhertance as no inhertance is ever required in this system. If you need a certain entity to have a certain functionality you just add the relevant component to it, and the systems that automatically go over specific components will give your entitiy the desired functionality. </p>
-<p><strong>&quot;But your framework also has <code>Scenes</code> and a <code>Stage</code>, what is that about?&quot;</strong> </p>
+<p><strong>&quot;But your framework also has <code>Scenes</code>, <code>Stage</code>, and <code>Order</code>, what is that about?&quot;</strong> </p>
<hr>
@@ -181,6 +187,10 @@ ECS stands for Entity, Component, and System.</p>
<p>The Stage is Scenes which are activated. This means any Scenes on the Stage are executed each frame, while the rest of the Systems are not.</p>
+<h3 id="order">Order</h3>
+
+<p>Order is a helper class which can set the priority of Scenes and Systems.</p>
+
<hr>
<h1 id="usage">Usage</h1>
@@ -504,6 +514,28 @@ E.g priority 1 will go first, priority 2 will go second, etcetera. </p>
<pre class="code ruby"><code class="ruby"><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="FelFlame/Stage.html" title="FelFlame::Stage (module)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_call'><span class='object_link'><a href="FelFlame/Stage.html#call-class_method" title="FelFlame::Stage.call (method)">call</a></span></span>
</code></pre>
+<h2 id="order">Order</h2>
+
+<h3 id="setting-the-order">Setting the order</h3>
+
+<p>To set the order you just need to call <code>FelFlame::Order.sort</code> and pass Scenes or Systems in the parameters in the order you wish for them to execute</p>
+
+<pre class="code ruby"><code class="ruby"><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="FelFlame/Order.html" title="FelFlame::Order (module)">Order</a></span></span><span class='period'>.</span><span class='id identifier rubyid_sort'><span class='object_link'><a href="FelFlame/Order.html#sort-class_method" title="FelFlame::Order.sort (method)">sort</a></span></span><span class='lparen'>(</span>
+ <span class='ivar'>@system1</span><span class='comma'>,</span>
+ <span class='ivar'>@system2</span><span class='comma'>,</span>
+ <span class='ivar'>@system3</span>
+<span class='rparen'>)</span>
+</code></pre>
+
+<p>If you want some Scenes or Systems to have the same priority then just pass them as an array:</p>
+
+<pre class="code ruby"><code class="ruby"><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="FelFlame/Order.html" title="FelFlame::Order (module)">Order</a></span></span><span class='period'>.</span><span class='id identifier rubyid_sort'><span class='object_link'><a href="FelFlame/Order.html#sort-class_method" title="FelFlame::Order.sort (method)">sort</a></span></span><span class='lparen'>(</span>
+ <span class='ivar'>@scene1</span><span class='comma'>,</span>
+ <span class='lbracket'>[</span><span class='ivar'>@scene2_1</span><span class='comma'>,</span> <span class='ivar'>@scene2_2</span><span class='rbracket'>]</span><span class='comma'>,</span>
+ <span class='ivar'>@scene3</span>
+<span class='rparen'>)</span>
+</code></pre>
+
<h2 id="closing-notes">Closing Notes</h2>
<p>There are some methods I haven&#39;t gone over in the overview. If you want to see everything and read in more detail check out the <a href="https://felflame.tradam.fyi">Documentation</a>!</p>
@@ -518,7 +550,7 @@ E.g priority 1 will go first, priority 2 will go second, etcetera. </p>
</div></div>
<div id="footer">
- Generated on Mon Jan 3 08:08:07 2022 by
+ Generated on Mon Jan 3 08:23:03 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>
diff --git a/docs/top-level-namespace.html b/docs/top-level-namespace.html
index 0a054fc..cc16af8 100644
--- a/docs/top-level-namespace.html
+++ b/docs/top-level-namespace.html
@@ -127,7 +127,7 @@
</div>
<div id="footer">
- Generated on Mon Jan 3 08:08:08 2022 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>
diff --git a/lib/felflame/order.rb b/lib/felflame/order.rb
index 3202b25..c11438d 100644
--- a/lib/felflame/order.rb
+++ b/lib/felflame/order.rb
@@ -1,11 +1,12 @@
+# frozen_string_literal: true
+
module FelFlame
module Order
-
- # Sets the priority of all items passed into this method
+ # Sets the priority of all items passed into this method
# according to the order they were passed.
# If an array is one of the elements then it will give all
# of those elements in the array the same priority.
- # @param sortables [(Systems and Array<Systems>) or (Scenes and Array<Scenes>)]
+ # @param sortables [(Systems and Array<Systems>) or (Scenes and Array<Scenes>)]
# @return [Boolean] +true+.
def self.sort(*sortables)
sortables.each_with_index do |sorted, index|
diff --git a/lib/felflame/version.rb b/lib/felflame/version.rb
index b200c26..9f7f09e 100644
--- a/lib/felflame/version.rb
+++ b/lib/felflame/version.rb
@@ -4,6 +4,6 @@
# Keeps the version of the Gem
module Felflame
# The version of the Gem
- VERSION = '3.0.0'
+ VERSION = '4.0.0'
end
# :nocov:
diff --git a/spec/order_spec.rb b/spec/order_spec.rb
index 2dfe7a6..fd104fc 100644
--- a/spec/order_spec.rb
+++ b/spec/order_spec.rb
@@ -53,7 +53,7 @@ describe 'Order' do
@system1
)
@scene0.call
- expect(@result).to eq([2,0,1])
+ expect(@result).to eq([2, 0, 1])
end
it 'can handle array' do