From ef9d4d0dcdebbd5ed314cb874e373031cae08438 Mon Sep 17 00:00:00 2001 From: realtradam Date: Mon, 3 Jan 2022 08:25:17 -0500 Subject: . --- Gemfile.lock | 2 +- docs/FelFlame.html | 2 +- docs/FelFlame/ComponentManager.html | 2 +- docs/FelFlame/Components.html | 2 +- docs/FelFlame/Entities.html | 2 +- docs/FelFlame/Order.html | 12 ++++++------ docs/FelFlame/Scenes.html | 2 +- docs/FelFlame/Stage.html | 2 +- docs/FelFlame/Systems.html | 2 +- docs/Felflame_.html | 4 ++-- docs/_index.html | 2 +- docs/file.README.html | 38 ++++++++++++++++++++++++++++++++++--- docs/index.html | 38 ++++++++++++++++++++++++++++++++++--- docs/top-level-namespace.html | 2 +- lib/felflame/order.rb | 7 ++++--- lib/felflame/version.rb | 2 +- spec/order_spec.rb | 2 +- 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 @@ 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 @@ 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 @@ 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 @@ 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 @@
-

Sets the priority of all items passed into this method according to the order they were passed.

+

Sets the priority of all items passed into this method according to the order they were passed.

@@ -156,7 +156,7 @@
-

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.

+

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.

@@ -203,7 +203,6 @@
 
 
-10
 11
 12
 13
@@ -214,10 +213,11 @@
 18
 19
 20
-21
+21 +22 -
# File 'lib/felflame/order.rb', line 10
+      
# File 'lib/felflame/order.rb', line 11
 
 def self.sort(*sortables)
   sortables.each_with_index do |sorted, index|
@@ -241,7 +241,7 @@
 
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 @@ 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 @@ 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 @@ 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 @@ -
'3.0.0'
+
'4.0.0'
@@ -133,7 +133,7 @@ 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 @@ 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 @@ * Entities * Systems * Scenes - * Stage + * Stage + * Order
  • Usage
  • +
  • Order + +
  • Closing Notes
  • Contribution
  • @@ -169,7 +175,7 @@ ECS stands for Entity, Component, and System.

    By using this pattern it allows programmers to easily control what an "object" 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.

    -

    "But your framework also has Scenes and a Stage, what is that about?"

    +

    "But your framework also has Scenes, Stage, and Order, what is that about?"


    @@ -181,6 +187,10 @@ ECS stands for Entity, Component, and System.

    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.

    +

    Order

    + +

    Order is a helper class which can set the priority of Scenes and Systems.

    +

    Usage

    @@ -504,6 +514,28 @@ E.g priority 1 will go first, priority 2 will go second, etcetera.

    FelFlame::Stage.call
     
    +

    Order

    + +

    Setting the order

    + +

    To set the order you just need to call FelFlame::Order.sort and pass Scenes or Systems in the parameters in the order you wish for them to execute

    + +
    FelFlame::Order.sort(
    +  @system1,
    +  @system2,
    +  @system3
    +)
    +
    + +

    If you want some Scenes or Systems to have the same priority then just pass them as an array:

    + +
    FelFlame::Order.sort(
    +  @scene1,
    +  [@scene2_1, @scene2_2],
    +  @scene3
    +) 
    +
    +

    Closing Notes

    There are some methods I haven't gone over in the overview. If you want to see everything and read in more detail check out the Documentation!

    @@ -518,7 +550,7 @@ E.g priority 1 will go first, priority 2 will go second, etcetera.

    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 @@ * Entities * Systems * Scenes - * Stage + * Stage + * Order
  • Usage
  • +
  • Order + +
  • Closing Notes
  • Contribution
  • @@ -169,7 +175,7 @@ ECS stands for Entity, Component, and System.

    By using this pattern it allows programmers to easily control what an "object" 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.

    -

    "But your framework also has Scenes and a Stage, what is that about?"

    +

    "But your framework also has Scenes, Stage, and Order, what is that about?"


    @@ -181,6 +187,10 @@ ECS stands for Entity, Component, and System.

    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.

    +

    Order

    + +

    Order is a helper class which can set the priority of Scenes and Systems.

    +

    Usage

    @@ -504,6 +514,28 @@ E.g priority 1 will go first, priority 2 will go second, etcetera.

    FelFlame::Stage.call
     
    +

    Order

    + +

    Setting the order

    + +

    To set the order you just need to call FelFlame::Order.sort and pass Scenes or Systems in the parameters in the order you wish for them to execute

    + +
    FelFlame::Order.sort(
    +  @system1,
    +  @system2,
    +  @system3
    +)
    +
    + +

    If you want some Scenes or Systems to have the same priority then just pass them as an array:

    + +
    FelFlame::Order.sort(
    +  @scene1,
    +  [@scene2_1, @scene2_2],
    +  @scene3
    +) 
    +
    +

    Closing Notes

    There are some methods I haven't gone over in the overview. If you want to see everything and read in more detail check out the Documentation!

    @@ -518,7 +550,7 @@ E.g priority 1 will go first, priority 2 will go second, etcetera.

    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 @@ 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) or (Scenes and Array)] + # @param sortables [(Systems and Array) or (Scenes and Array)] # @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 -- cgit v1.2.3