diff options
| -rw-r--r-- | Rakefile | 2 | ||||
| -rw-r--r-- | component_manager.rb | 312 | ||||
| -rw-r--r-- | docs/FelFlame.html | 122 | ||||
| -rw-r--r-- | docs/FelFlame/ComponentManager.html | 1627 | ||||
| -rw-r--r-- | docs/FelFlame/Components.html | 32 | ||||
| -rw-r--r-- | docs/FelFlame/Entities.html | 266 | ||||
| -rw-r--r-- | docs/FelFlame/Helper.html | 2 | ||||
| -rw-r--r-- | docs/FelFlame/Helper/ComponentManager.html | 147 | ||||
| -rw-r--r-- | docs/FelFlame/Scenes.html | 761 | ||||
| -rw-r--r-- | docs/FelFlame/Stage.html | 598 | ||||
| -rw-r--r-- | docs/FelFlame/Systems.html | 150 | ||||
| -rw-r--r-- | docs/_index.html | 25 | ||||
| -rw-r--r-- | docs/class_list.html | 2 | ||||
| -rw-r--r-- | docs/file.README.html | 6 | ||||
| -rw-r--r-- | docs/index.html | 6 | ||||
| -rw-r--r-- | docs/method_list.html | 174 | ||||
| -rw-r--r-- | docs/top-level-namespace.html | 2 | ||||
| -rw-r--r-- | entity_manager.rb | 22 | ||||
| -rw-r--r-- | felflame.rb | 47 | ||||
| -rw-r--r-- | scene_manager.rb | 52 | ||||
| -rw-r--r-- | stage_manager.rb | 66 | ||||
| -rw-r--r-- | system_manager.rb | 18 |
22 files changed, 3758 insertions, 681 deletions
@@ -29,7 +29,7 @@ namespace :coverage do end YARD::Rake::YardocTask.new do |t| - t.files = ['system_manager.rb', 'component_manager.rb', 'entity_manager.rb', 'felflame.rb'] + t.files = ['system_manager.rb', 'component_manager.rb', 'entity_manager.rb', 'scene_manager.rb', 'stage_manager.rb', 'felflame.rb'] t.options = ['--output-dir', './docs', 'yardoc --markup=markdown|textile|rdoc(default)'] t.stats_options = ['--list-undoc'] end diff --git a/component_manager.rb b/component_manager.rb index c81f645..3ffdff3 100644 --- a/component_manager.rb +++ b/component_manager.rb @@ -7,7 +7,7 @@ class FelFlame @component_map = [] class <<self include Enumerable - # Creates a new {FelFlame::Helper::ComponentManager component manager}. + # Creates a new {FelFlame::ComponentManager component manager}. # # @example # # Here color is set to default to red @@ -25,12 +25,13 @@ class FelFlame raise(NameError.new, "Component Manager '#{component_name}' is already defined") end - const_set(component_name, Class.new(FelFlame::Helper::ComponentManager) {}) + + const_set(component_name, Class.new(FelFlame::ComponentManager) {}) attrs.each do |attr| FelFlame::Components.const_get(component_name).attr_accessor attr end attrs_with_defaults.each do |attr, _default| - #FelFlame::Components.const_get(component_name).attr_accessor attr + attrs_with_defaults[attr] = _default.dup FelFlame::Components.const_get(component_name).attr_reader attr FelFlame::Components.const_get(component_name).define_method("#{attr}=") do |value| attr_changed_trigger_systems(attr) unless value.equal? send(attr) @@ -39,7 +40,7 @@ class FelFlame end FelFlame::Components.const_get(component_name).define_method(:set_defaults) do attrs_with_defaults.each do |attr, default| - instance_variable_set("@#{attr}", default) + instance_variable_set("@#{attr}", default.dup) end end FelFlame::Components.const_get(component_name) @@ -52,21 +53,75 @@ class FelFlame end end end - # Namespace for helper functions and template classes - class Helper - # Component Managers are what is used to create individual components which can be attached to entities. - # When a Component is created from a Component Manager that has accessors given to it, you can set or get the values of those accessors using standard ruby message sending (e.g [email protected] = 5+), or by using the {#attrs} and {#update_attrs} methods instead. - class ComponentManager - - # Holds the {id unique ID} of a component. The {id ID} is only unique within the scope of the component manager it was created from. - # @return [Integer] - attr_reader :id - - # A seperate attr_writer was made for documentation readability reasons. - # Yard will list attr_reader is readonly which is my intention. - # This value needs to be changable as it is set by other functions. - # @!visibility private - attr_writer :id + + # Component Managers are what is used to create individual components which can be attached to entities. + # When a Component is created from a Component Manager that has accessors given to it, you can set or get the values of those accessors using standard ruby message sending (e.g [email protected] = 5+), or by using the {#attrs} and {#update_attrs} methods instead. + class ComponentManager + + # Holds the {id unique ID} of a component. The {id ID} is only unique within the scope of the component manager it was created from. + # @return [Integer] + attr_reader :id + + # A seperate attr_writer was made for documentation readability reasons. + # Yard will list attr_reader is readonly which is my intention. + # This value needs to be changable as it is set by other functions. + # @!visibility private + attr_writer :id + + # Allows overwriting the storage of triggers, such as for clearing. + # This method should generally only need to be used internally and + # not by a game developer. + # @!visibility private + attr_writer :addition_triggers, :removal_triggers, :attr_triggers + + # Stores references to systems that should be triggered when a + # component from this manager is added. + # Do not edit this array as it is managed by FelFlame automatically. + # @return [Array<System>] + def addition_triggers + @addition_triggers ||= [] + end + + # Stores references to systems that should be triggered when a + # component from this manager is removed. + # Do not edit this array as it is managed by FelFlame automatically. + # @return [Array<System>] + def removal_triggers + @removal_triggers ||= [] + end + + # Stores references to systems that should be triggered when an + # attribute from this manager is changed. + # Do not edit this hash as it is managed by FelFlame automatically. + # @return [Hash<Symbol, Array<System>>] + def attr_triggers + @attr_triggers ||= {} + end + + # Creates a new component and sets the values of the attributes given to it. If an attritbute is not passed then it will remain as the default. + # @param attrs [Keyword: Value] You can pass any number of Keyword-Value pairs + # @return [Component] + def initialize(**attrs) + # Prepare the object + # (this is a function created with metaprogramming + # in FelFlame::Components + set_defaults + + # Generate ID + new_id = self.class.data.find_index { |i| i.nil? } + new_id = self.class.data.size if new_id.nil? + @id = new_id + + # Fill params + attrs.each do |key, value| + send "#{key}=", value + end + + # Save Component + self.class.data[new_id] = self + end + + class <<self # Allows overwriting the storage of triggers, such as for clearing. # This method should generally only need to be used internally and @@ -74,16 +129,16 @@ class FelFlame # @!visibility private attr_writer :addition_triggers, :removal_triggers, :attr_triggers - # Stores references to systems that should be triggered when a - # component from this manager is added. + # Stores references to systems that should be triggered when this + # component is added to an enitity. # Do not edit this array as it is managed by FelFlame automatically. # @return [Array<System>] def addition_triggers @addition_triggers ||= [] end - # Stores references to systems that should be triggered when a - # component from this manager is removed. + # Stores references to systems that should be triggered when this + # component is removed from an enitity. # Do not edit this array as it is managed by FelFlame automatically. # @return [Array<System>] def removal_triggers @@ -91,161 +146,104 @@ class FelFlame end # Stores references to systems that should be triggered when an - # attribute from this manager is changed. + # attribute from this component changed. # Do not edit this hash as it is managed by FelFlame automatically. - # @return [Hash<Symbol, Array<System>>] + # @return [Hash<Symbol, System>] def attr_triggers @attr_triggers ||= {} end - # Creates a new component and sets the values of the attributes given to it. If an attritbute is not passed then it will remain as the default. - # @param attrs [Keyword: Value] You can pass any number of Keyword-Value pairs - # @return [Component] - def initialize(**attrs) - # Prepare the object - # (this is a function created with metaprogramming - # in FelFlame::Components - set_defaults - - # Generate ID - new_id = self.class.data.find_index { |i| i.nil? } - new_id = self.class.data.size if new_id.nil? - @id = new_id - - # Fill params - attrs.each do |key, value| - send "#{key}=", value - end - - # Save Component - self.class.data[new_id] = self + # @return [Array<Component>] Array of all Components that belong to a given component manager + # @!visibility private + def data + @data ||= [] end - class <<self - - # Allows overwriting the storage of triggers, such as for clearing. - # This method should generally only need to be used internally and - # not by a game developer. - # @!visibility private - attr_writer :addition_triggers, :removal_triggers, :attr_triggers - - # Stores references to systems that should be triggered when this - # component is added to an enitity. - # Do not edit this array as it is managed by FelFlame automatically. - # @return [Array<System>] - def addition_triggers - @addition_triggers ||= [] - end - - # Stores references to systems that should be triggered when this - # component is removed from an enitity. - # Do not edit this array as it is managed by FelFlame automatically. - # @return [Array<System>] - def removal_triggers - @removal_triggers ||= [] - end - - # Stores references to systems that should be triggered when an - # attribute from this component changed. - # Do not edit this hash as it is managed by FelFlame automatically. - # @return [Hash<Symbol, System>] - def attr_triggers - @attr_triggers ||= {} - end - - # @return [Array<Component>] Array of all Components that belong to a given component manager - # @!visibility private - def data - @data ||= [] - end - - # Gets a Component from the given {id unique ID}. Usage is simular to how an Array lookup works. - # - # @example - # # this gets the 'Health' Component with ID 7 - # FelFlame::Components::Health[7] - # @param component_id [Integer] - # @return [Component] Returns the Component that uses the given unique {id ID}, nil if there is no Component associated with the given {id ID} - def [](component_id) - data[component_id] - end - - # Iterates over all components within the component manager. - # Special Enumerable methods like +map+ or +each_with_index+ are not implemented - # @return [Enumerator] - def each(&block) - data.compact.each(&block) - end + # Gets a Component from the given {id unique ID}. Usage is simular to how an Array lookup works. + # + # @example + # # this gets the 'Health' Component with ID 7 + # FelFlame::Components::Health[7] + # @param component_id [Integer] + # @return [Component] Returns the Component that uses the given unique {id ID}, nil if there is no Component associated with the given {id ID} + def [](component_id) + data[component_id] end - # An alias for the {id ID Reader} - # @return [Integer] - def to_i - id + # Iterates over all components within the component manager. + # Special Enumerable methods like +map+ or +each_with_index+ are not implemented + # @return [Enumerator] + def each(&block) + data.compact.each(&block) end + end - # A list of entity ids that are linked to the component - # @return [Array<Integer>] - def entities - @entities ||= [] - end + # An alias for the {id ID Reader} + # @return [Integer] + def to_i + id + end - # Update attribute values using a hash or keywords. - # @return Hash of updated attributes - def update_attrs(**opts) - opts.each do |key, value| - send "#{key}=", value - end + # A list of entity ids that are linked to the component + # @return [Array<Integer>] + def entities + @entities ||= [] + end + + # Update attribute values using a hash or keywords. + # @return [Hash<Symbol, Value>] Hash of updated attributes + def update_attrs(**opts) + opts.each do |key, value| + send "#{key}=", value end + end - # Execute systems that have been added to execute on variable change - def attr_changed_trigger_systems(attr) - systems_to_execute = self.class.attr_triggers[attr] - systems_to_execute = [] if systems_to_execute.nil? + # Execute systems that have been added to execute on variable change + # @return [Boolean] +true+ + def attr_changed_trigger_systems(attr) + systems_to_execute = self.class.attr_triggers[attr] + systems_to_execute = [] if systems_to_execute.nil? - systems_to_execute |= attr_triggers[attr] unless attr_triggers[attr].nil? + systems_to_execute |= attr_triggers[attr] unless attr_triggers[attr].nil? - systems_to_execute.sort_by(&:priority).reverse.each(&:call) - #self.attr_triggers.each do |system| - # systems_to_execute |= [system] - #end - end + systems_to_execute.sort_by(&:priority).reverse.each(&:call) + true + end - # Removes this component from the list and purges all references to this Component from other Entities, as well as its {id ID} and data. - # @return [Boolean] true. - def delete - addition_triggers.each do |system| - system.clear_triggers component_or_manager: self - end - # This needs to be cloned because indices get deleted as - # the remove command is called, breaking the loop if it - # wasn't referencing a clone(will get Nil errors) - iter = entities.map(&:clone) - iter.each do |entity_id| - FelFlame::Entities[entity_id].remove self #unless FelFlame::Entities[entity_id].nil? - end - self.class.data[id] = nil - instance_variables.each do |var| - instance_variable_set(var, nil) - end - true + # Removes this component from the list and purges all references to this Component from other Entities, as well as its {id ID} and data. + # @return [Boolean] +true+. + def delete + addition_triggers.each do |system| + system.clear_triggers component_or_manager: self end - - # @return [Hash] A hash, where all the keys are attributes linked to their respective values. - def attrs - return_hash = instance_variables.each_with_object({}) do |key, final| - final[key.to_s.delete_prefix('@').to_sym] = instance_variable_get(key) - end - return_hash.delete(:attr_triggers) - return_hash + # This needs to be cloned because indices get deleted as + # the remove command is called, breaking the loop if it + # wasn't referencing a clone(will get Nil errors) + iter = entities.map(&:clone) + iter.each do |entity_id| + FelFlame::Entities[entity_id].remove self #unless FelFlame::Entities[entity_id].nil? end + self.class.data[id] = nil + instance_variables.each do |var| + instance_variable_set(var, nil) + end + true + end - # Export all data into a JSON String, which could then later be loaded or saved to a file - # TODO: This function is not yet complete - # @return [String] a JSON formatted String - def to_json - # should return a json or hash of all data in this component + # @return [Hash<Symbol, Value>] A hash, where all the keys are attributes linked to their respective values. + def attrs + return_hash = instance_variables.each_with_object({}) do |key, final| + final[key.to_s.delete_prefix('@').to_sym] = instance_variable_get(key) end + return_hash.delete(:attr_triggers) + return_hash end + + # Export all data into a JSON String, which could then later be loaded or saved to a file + # TODO: This function is not yet complete + # @return [String] a JSON formatted String + #def to_json + # # should return a json or hash of all data in this component + #end end end diff --git a/docs/FelFlame.html b/docs/FelFlame.html index 9439492..62ce5bb 100644 --- a/docs/FelFlame.html +++ b/docs/FelFlame.html @@ -95,7 +95,7 @@ <dl> <dt>Defined in:</dt> <dd>component_manager.rb<span class="defines">,<br /> - system_manager.rb,<br /> entity_manager.rb,<br /> felflame.rb</span> + system_manager.rb,<br /> entity_manager.rb,<br /> scene_manager.rb,<br /> stage_manager.rb,<br /> felflame.rb</span> </dd> </dl> @@ -104,7 +104,7 @@ <h2>Overview</h2><div class="docstring"> <div class="discussion"> -<p>require 'app/ECS/components/00_test_component.rb' require 'app/ECS/components/01_based.rb'</p> +<p>The FelFlame namespace where all its functionality resides under.</p> </div> @@ -118,7 +118,7 @@ - <strong class="classes">Classes:</strong> <span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span>, <span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span>, <span class='object_link'><a href="FelFlame/Helper.html" title="FelFlame::Helper (class)">Helper</a></span>, <span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span> + <strong class="classes">Classes:</strong> <span class='object_link'><a href="FelFlame/ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span>, <span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span>, <span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span>, <span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span>, <span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span>, <span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span> </p> @@ -179,6 +179,38 @@ </dt> <dd><pre class="code"><span class='const'>FelFlame</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span></pre></dd> + <dt id="Sce-constant" class="">Sce = + <div class="docstring"> + <div class="discussion"> + +<p>An alias for <span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></p> + + + </div> +</div> +<div class="tags"> + + +</div> + </dt> + <dd><pre class="code"><span class='const'>FelFlame</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span></pre></dd> + + <dt id="Stg-constant" class="">Stg = + <div class="docstring"> + <div class="discussion"> + +<p>An alias for <span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span></p> + + + </div> +</div> +<div class="tags"> + + +</div> + </dt> + <dd><pre class="code"><span class='const'>FelFlame</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span></pre></dd> + </dl> @@ -188,12 +220,94 @@ + + <h2> + Class Method Summary + <small><a href="#" class="summary_toggle">collapse</a></small> + </h2> + + <ul class="summary"> + + <li class="public "> + <span class="summary_signature"> + + <a href="#call-class_method" title="call (class method)">.<strong>call</strong> ⇒ Object </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>An alias for <span class='object_link'><a href="FelFlame/Stage.html#call-class_method" title="FelFlame::Stage.call (method)">Stage.call</a></span>.</p> +</div></span> + +</li> + + + </ul> + + + + + <div id="class_method_details" class="method_details_list"> + <h2>Class Method Details</h2> + + + <div class="method_details first"> + <h3 class="signature first" id="call-class_method"> + + .<strong>call</strong> ⇒ <tt>Object</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>An alias for <span class='object_link'><a href="FelFlame/Stage.html#call-class_method" title="FelFlame::Stage.call (method)">FelFlame::Stage.call</a></span>. It executes a single frame in the game.</p> + + </div> +</div> +<div class="tags"> + + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +13 +14 +15</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'felflame.rb', line 13</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span> + <span class='const'><span class='object_link'><a href="" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">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> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + </div> </div> <div id="footer"> - Generated on Wed Jul 7 01:04:28 2021 by + Generated on Wed Jul 7 17:45:24 2021 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 new file mode 100644 index 0000000..ef75405 --- /dev/null +++ b/docs/FelFlame/ComponentManager.html @@ -0,0 +1,1627 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> +<title> + Class: FelFlame::ComponentManager + + — Documentation by YARD 0.9.26 + +</title> + + <link rel="stylesheet" href="../css/style.css" type="text/css" /> + + <link rel="stylesheet" href="../css/common.css" type="text/css" /> + +<script type="text/javascript"> + pathId = "FelFlame::ComponentManager"; + relpath = '../'; +</script> + + + <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script> + + <script type="text/javascript" charset="utf-8" src="../js/app.js"></script> + + + </head> + <body> + <div class="nav_wrap"> + <iframe id="nav" src="../class_list.html?1"></iframe> + <div id="resizer"></div> + </div> + + <div id="main" tabindex="-1"> + <div id="header"> + <div id="menu"> + + <a href="../_index.html">Index (C)</a> » + <span class='title'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span> + » + <span class="title">ComponentManager</span> + +</div> + + <div id="search"> + + <a class="full_list_link" id="class_list_link" + href="../class_list.html"> + + <svg width="24" height="24"> + <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect> + <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect> + <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect> + </svg> + </a> + +</div> + <div class="clear"></div> + </div> + + <div id="content"><h1>Class: FelFlame::ComponentManager + + + +</h1> +<div class="box_info"> + + <dl> + <dt>Inherits:</dt> + <dd> + <span class="inheritName">Object</span> + + <ul class="fullTree"> + <li>Object</li> + + <li class="next">FelFlame::ComponentManager</li> + + </ul> + <a href="#" class="inheritanceTree">show all</a> + + </dd> + </dl> + + + + + + + + + + + + <dl> + <dt>Defined in:</dt> + <dd>component_manager.rb</dd> + </dl> + +</div> + +<h2>Overview</h2><div class="docstring"> + <div class="discussion"> + +<p>Component Managers are what is used to create individual components which can be attached to entities. When a Component is created from a Component Manager that has accessors given to it, you can set or get the values of those accessors using standard ruby message sending (e.g <tt>@component.var = 5</tt>), or by using the <span class='object_link'><a href="#attrs-instance_method" title="FelFlame::ComponentManager#attrs (method)">#attrs</a></span> and <span class='object_link'><a href="#update_attrs-instance_method" title="FelFlame::ComponentManager#update_attrs (method)">#update_attrs</a></span> methods instead.</p> + + + </div> +</div> +<div class="tags"> + + +</div> + + + + <h2>Class Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2> + <ul class="summary"> + + <li class="public "> + <span class="summary_signature"> + + <a href="#addition_triggers-class_method" title="addition_triggers (class method)">.<strong>addition_triggers</strong> ⇒ Array<System> </a> + + + + </span> + + + + + <span class="note title readonly">readonly</span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Stores references to systems that should be triggered when this component is added to an enitity.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#attr_triggers-class_method" title="attr_triggers (class method)">.<strong>attr_triggers</strong> ⇒ Hash<Symbol, System> </a> + + + + </span> + + + + + <span class="note title readonly">readonly</span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Stores references to systems that should be triggered when an attribute from this component changed.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#removal_triggers-class_method" title="removal_triggers (class method)">.<strong>removal_triggers</strong> ⇒ Array<System> </a> + + + + </span> + + + + + <span class="note title readonly">readonly</span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Stores references to systems that should be triggered when this component is removed from an enitity.</p> +</div></span> + +</li> + + + </ul> + + <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="#addition_triggers-instance_method" title="#addition_triggers (instance method)">#<strong>addition_triggers</strong> ⇒ Array<System> </a> + + + + </span> + + + + + <span class="note title readonly">readonly</span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Stores references to systems that should be triggered when a component from this manager is added.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#attr_triggers-instance_method" title="#attr_triggers (instance method)">#<strong>attr_triggers</strong> ⇒ Hash<Symbol, Array<System>> </a> + + + + </span> + + + + + <span class="note title readonly">readonly</span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Stores references to systems that should be triggered when an attribute from this manager is changed.</p> +</div></span> + +</li> + + + <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 <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">unique ID</a></span> of a component.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#removal_triggers-instance_method" title="#removal_triggers (instance method)">#<strong>removal_triggers</strong> ⇒ Array<System> </a> + + + + </span> + + + + + <span class="note title readonly">readonly</span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Stores references to systems that should be triggered when a component from this manager is removed.</p> +</div></span> + +</li> + + + </ul> + + + + + + <h2> + Class 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>(component_id) ⇒ Component </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Gets a Component from the given <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">unique ID</a></span>.</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> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Iterates over all components within the 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="#attr_changed_trigger_systems-instance_method" title="#attr_changed_trigger_systems (instance method)">#<strong>attr_changed_trigger_systems</strong>(attr) ⇒ Boolean </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Execute systems that have been added to execute on variable change.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#attrs-instance_method" title="#attrs (instance method)">#<strong>attrs</strong> ⇒ Hash<Symbol, Value> </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>A hash, where all the keys are attributes linked to their respective values.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong> ⇒ Boolean </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Removes this component from the list and purges all references to this Component from other Entities, as well as its <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">ID</a></span> and data.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#entities-instance_method" title="#entities (instance method)">#<strong>entities</strong> ⇒ Array<Integer> </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>A list of entity ids that are linked to the component.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(**attrs) ⇒ Component </a> + + + + </span> + + + <span class="note title constructor">constructor</span> + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Creates a new component and sets the values of the attributes given to it.</p> +</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::ComponentManager#id (method)">ID Reader</a></span>.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#update_attrs-instance_method" title="#update_attrs (instance method)">#<strong>update_attrs</strong>(**opts) ⇒ Hash<Symbol, Value> </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Update attribute values using a hash or keywords.</p> +</div></span> + +</li> + + + </ul> + + +<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"> + + #<strong>initialize</strong>(**attrs) ⇒ <tt>Component</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Creates a new component and sets the values of the attributes given to it. If an attritbute is not passed then it will remain as the default.</p> + + + </div> +</div> +<div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + + <li> + + <span class='name'>attrs</span> + + + <span class='type'>(<tt>Keyword: Value</tt>)</span> + + + + — + <div class='inline'> +<p>You can pass any number of Keyword-Value pairs</p> +</div> + + </li> + +</ul> + + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 104</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_attrs'>attrs</span><span class='rparen'>)</span> + <span class='comment'># Prepare the object +</span> <span class='comment'># (this is a function created with metaprogramming +</span> <span class='comment'># in FelFlame::Components +</span> <span class='id identifier rubyid_set_defaults'>set_defaults</span> + + <span class='comment'># Generate 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='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_i'>i</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='rbrace'>}</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='ivar'>@id</span> <span class='op'>=</span> <span class='id identifier rubyid_new_id'>new_id</span> + + <span class='comment'># Fill params +</span> <span class='id identifier rubyid_attrs'>attrs</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_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> + <span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> + <span class='kw'>end</span> + + <span class='comment'># Save Component +</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_new_id'>new_id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>self</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + +</div> + + <div id="class_attr_details" class="attr_details"> + <h2>Class Attribute Details</h2> + + + <span id="addition_triggers=-class_method"></span> + <div class="method_details first"> + <h3 class="signature first" id="addition_triggers-class_method"> + + .<strong>addition_triggers</strong> ⇒ <tt>Array<System></tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Stores references to systems that should be triggered when this component is added to an enitity. Do not edit this array as it is managed by FelFlame automatically.</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Array<System></tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +136 +137 +138</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 136</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_addition_triggers'>addition_triggers</span> + <span class='ivar'>@addition_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + + <span id="attr_triggers=-class_method"></span> + <div class="method_details "> + <h3 class="signature " id="attr_triggers-class_method"> + + .<strong>attr_triggers</strong> ⇒ <tt>Hash<Symbol, System></tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Stores references to systems that should be triggered when an attribute from this component changed. Do not edit this hash as it is managed by FelFlame automatically.</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Hash<Symbol, System></tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +152 +153 +154</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 152</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span> + <span class='ivar'>@attr_triggers</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + + <span id="removal_triggers=-class_method"></span> + <div class="method_details "> + <h3 class="signature " id="removal_triggers-class_method"> + + .<strong>removal_triggers</strong> ⇒ <tt>Array<System></tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Stores references to systems that should be triggered when this component is removed from an enitity. Do not edit this array as it is managed by FelFlame automatically.</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Array<System></tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +144 +145 +146</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 144</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_removal_triggers'>removal_triggers</span> + <span class='ivar'>@removal_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</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="addition_triggers=-instance_method"></span> + <div class="method_details first"> + <h3 class="signature first" id="addition_triggers-instance_method"> + + #<strong>addition_triggers</strong> ⇒ <tt>Array<System></tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Stores references to systems that should be triggered when a component from this manager is added. Do not edit this array as it is managed by FelFlame automatically.</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Array<System></tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +81 +82 +83</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 81</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_addition_triggers'>addition_triggers</span> + <span class='ivar'>@addition_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + + <span id="attr_triggers=-instance_method"></span> + <div class="method_details "> + <h3 class="signature " id="attr_triggers-instance_method"> + + #<strong>attr_triggers</strong> ⇒ <tt>Hash<Symbol, Array<System>></tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Stores references to systems that should be triggered when an attribute from this manager is changed. Do not edit this hash as it is managed by FelFlame automatically.</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Hash<Symbol, Array<System>></tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +97 +98 +99</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 97</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span> + <span class='ivar'>@attr_triggers</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + + <span id="id=-instance_method"></span> + <div class="method_details "> + <h3 class="signature " id="id-instance_method"> + + #<strong>id</strong> ⇒ <tt>Integer</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Holds the <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">unique ID</a></span> of a component. The <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">ID</a></span> is only unique within the scope of the component manager it was created from.</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"> + + +63 +64 +65</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 63</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> + + + <span id="removal_triggers=-instance_method"></span> + <div class="method_details "> + <h3 class="signature " id="removal_triggers-instance_method"> + + #<strong>removal_triggers</strong> ⇒ <tt>Array<System></tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Stores references to systems that should be triggered when a component from this manager is removed. Do not edit this array as it is managed by FelFlame automatically.</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Array<System></tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +89 +90 +91</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 89</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_removal_triggers'>removal_triggers</span> + <span class='ivar'>@removal_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</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"> + + .<strong>[]</strong>(component_id) ⇒ <tt>Component</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Gets a Component from the given <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">unique ID</a></span>. Usage is simular to how an Array lookup works.</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 'Health' Component 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="Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Health</span><span class='lbracket'>[</span><span class='int'>7</span><span class='rbracket'>]</span></code></pre> + + </div> +<p class="tag_title">Parameters:</p> +<ul class="param"> + + <li> + + <span class='name'>component_id</span> + + + <span class='type'>(<tt>Integer</tt>)</span> + + + + </li> + +</ul> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Component</tt>)</span> + + + + — + <div class='inline'> +<p>Returns the Component that uses the given unique <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">ID</a></span>, nil if there is no Component associated with the given <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">ID</a></span></p> +</div> + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +169 +170 +171</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 169</span> + +<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rparen'>)</span> + <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rbracket'>]</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="each-class_method"> + + .<strong>each</strong>(&block) ⇒ <tt>Enumerator</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Iterates over all components within the component manager. Special Enumerable methods like <code>map</code> or <code>each_with_index</code> are not implemented</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Enumerator</tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +176 +177 +178</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 176</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> + + </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="attr_changed_trigger_systems-instance_method"> + + #<strong>attr_changed_trigger_systems</strong>(attr) ⇒ <tt>Boolean</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Execute systems that have been added to execute on variable change</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Boolean</tt>)</span> + + + + — + <div class='inline'> +<p><code>true</code></p> +</div> + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +203 +204 +205 +206 +207 +208 +209 +210 +211</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 203</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_attr_changed_trigger_systems'>attr_changed_trigger_systems</span><span class='lparen'>(</span><span class='id identifier rubyid_attr'>attr</span><span class='rparen'>)</span> + <span class='id identifier rubyid_systems_to_execute'>systems_to_execute</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_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span> + <span class='id identifier rubyid_systems_to_execute'>systems_to_execute</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_systems_to_execute'>systems_to_execute</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> + + <span class='id identifier rubyid_systems_to_execute'>systems_to_execute</span> <span class='op'>|=</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span> <span class='kw'>unless</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> + + <span class='id identifier rubyid_systems_to_execute'>systems_to_execute</span><span class='period'>.</span><span class='id identifier rubyid_sort_by'>sort_by</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:priority</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_reverse'>reverse</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:call</span><span class='rparen'>)</span> + <span class='kw'>true</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="attrs-instance_method"> + + #<strong>attrs</strong> ⇒ <tt>Hash<Symbol, Value></tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Returns A hash, where all the keys are attributes linked to their respective values.</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Hash<Symbol, Value></tt>)</span> + + + + — + <div class='inline'> +<p>A hash, where all the keys are attributes linked to their respective values.</p> +</div> + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +234 +235 +236 +237 +238 +239 +240</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 234</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_attrs'>attrs</span> + <span class='id identifier rubyid_return_hash'>return_hash</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_variables'>instance_variables</span><span class='period'>.</span><span class='id identifier rubyid_each_with_object'>each_with_object</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_final'>final</span><span class='op'>|</span> + <span class='id identifier rubyid_final'>final</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_delete_prefix'>delete_prefix</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>@</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_variable_get'>instance_variable_get</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> + <span class='kw'>end</span> + <span class='id identifier rubyid_return_hash'>return_hash</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:attr_triggers</span><span class='rparen'>)</span> + <span class='id identifier rubyid_return_hash'>return_hash</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="delete-instance_method"> + + #<strong>delete</strong> ⇒ <tt>Boolean</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Removes this component from the list and purges all references to this Component from other Entities, as well as its <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">ID</a></span> and data.</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Boolean</tt>)</span> + + + + — + <div class='inline'> +<p><code>true</code>.</p> +</div> + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 215</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span> + <span class='id identifier rubyid_addition_triggers'>addition_triggers</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_system'>system</span><span class='op'>|</span> + <span class='id identifier rubyid_system'>system</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span> <span class='label'>component_or_manager:</span> <span class='kw'>self</span> + <span class='kw'>end</span> + <span class='comment'># This needs to be cloned because indices get deleted as +</span> <span class='comment'># the remove command is called, breaking the loop if it +</span> <span class='comment'># wasn't referencing a clone(will get Nil errors) +</span> <span class='id identifier rubyid_iter'>iter</span> <span class='op'>=</span> <span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:clone</span><span class='rparen'>)</span> + <span class='id identifier rubyid_iter'>iter</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_entity_id'>entity_id</span><span class='op'>|</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="Entities.html" title="FelFlame::Entities (class)">Entities</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span> <span class='kw'>self</span> <span class='comment'>#unless FelFlame::Entities[entity_id].nil? +</span> <span class='kw'>end</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'>nil</span> + <span class='id identifier rubyid_instance_variables'>instance_variables</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_var'>var</span><span class='op'>|</span> + <span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='id identifier rubyid_var'>var</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</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="entities-instance_method"> + + #<strong>entities</strong> ⇒ <tt>Array<Integer></tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>A list of entity ids that are linked to the component</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Array<Integer></tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +189 +190 +191</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 189</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_entities'>entities</span> + <span class='ivar'>@entities</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</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::ComponentManager#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"> + + +183 +184 +185</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 183</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 class="method_details "> + <h3 class="signature " id="update_attrs-instance_method"> + + #<strong>update_attrs</strong>(**opts) ⇒ <tt>Hash<Symbol, Value></tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Update attribute values using a hash or keywords.</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Hash<Symbol, Value></tt>)</span> + + + + — + <div class='inline'> +<p>Hash of updated attributes</p> +</div> + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +195 +196 +197 +198 +199</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 195</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_update_attrs'>update_attrs</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span> + <span class='id identifier rubyid_opts'>opts</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_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> + <span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> + <span class='kw'>end</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + </div> + +</div> + + <div id="footer"> + Generated on Wed Jul 7 17:45:24 2021 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> + </body> +</html>
\ No newline at end of file diff --git a/docs/FelFlame/Components.html b/docs/FelFlame/Components.html index 0690cfe..de48255 100644 --- a/docs/FelFlame/Components.html +++ b/docs/FelFlame/Components.html @@ -111,9 +111,7 @@ <p>Creates component managers and allows accessing them them under the <span class='object_link'><a href="" title="FelFlame::Components (class)">Components</a></span> namespace as Constants</p> -<p>To see how component managers are used please look at the Helper::ComponentManagerTemplate documentation.</p> - -<p>TODO: Improve Component overview</p> +<p>To see how component managers are used please look at the <span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span> documentation.</p> </div> @@ -178,7 +176,7 @@ <span class="summary_desc"><div class='inline'> -<p>Creates a new <span class='object_link'><a href="Helper/ComponentManager.html" title="FelFlame::Helper::ComponentManager (class)">component manager</a></span>.</p> +<p>Creates a new <span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">component manager</a></span>.</p> </div></span> </li> @@ -233,12 +231,12 @@ <pre class="lines"> -50 51 -52</pre> +52 +53</pre> </td> <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 50</span> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 51</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_constants'>constants</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> @@ -251,7 +249,7 @@ <div class="method_details "> <h3 class="signature " id="new-class_method"> - .<strong>new</strong>(component_name, *attrs, **attrs_with_defaults) ⇒ <tt>ComponentManager</tt> + .<strong>new</strong>(component_name, *attrs, **attrs_with_defaults) ⇒ <tt><span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span></tt> @@ -260,7 +258,7 @@ </h3><div class="docstring"> <div class="discussion"> -<p>Creates a new <span class='object_link'><a href="Helper/ComponentManager.html" title="FelFlame::Helper::ComponentManager (class)">component manager</a></span>.</p> +<p>Creates a new <span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">component manager</a></span>.</p> </div> @@ -337,7 +335,7 @@ <li> - <span class='type'>(<tt>ComponentManager</tt>)</span> + <span class='type'>(<tt><span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span></tt>)</span> @@ -374,7 +372,8 @@ 43 44 45 -46</pre> +46 +47</pre> </td> <td> <pre class="code"><span class="info file"># File 'component_manager.rb', line 23</span> @@ -384,13 +383,14 @@ <span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='const'>NameError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Component Manager '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_component_name'>component_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>' is already defined</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>end</span> - <span class='id identifier rubyid_const_set'>const_set</span><span class='lparen'>(</span><span class='id identifier rubyid_component_name'>component_name</span><span class='comma'>,</span> <span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</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="Helper.html" title="FelFlame::Helper (class)">Helper</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Helper/ComponentManager.html" title="FelFlame::Helper::ComponentManager (class)">ComponentManager</a></span></span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> + + <span class='id identifier rubyid_const_set'>const_set</span><span class='lparen'>(</span><span class='id identifier rubyid_component_name'>component_name</span><span class='comma'>,</span> <span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</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="ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span></span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='id identifier rubyid_attrs'>attrs</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_attr'>attr</span><span class='op'>|</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::Components (class)">Components</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_name'>component_name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='id identifier rubyid_attr'>attr</span> <span class='kw'>end</span> <span class='id identifier rubyid_attrs_with_defaults'>attrs_with_defaults</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_attr'>attr</span><span class='comma'>,</span> <span class='id identifier rubyid__default'>_default</span><span class='op'>|</span> - <span class='comment'>#FelFlame::Components.const_get(component_name).attr_accessor attr -</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::Components (class)">Components</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_name'>component_name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_attr_reader'>attr_reader</span> <span class='id identifier rubyid_attr'>attr</span> + <span class='id identifier rubyid_attrs_with_defaults'>attrs_with_defaults</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid__default'>_default</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</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::Components (class)">Components</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_name'>component_name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_attr_reader'>attr_reader</span> <span class='id identifier rubyid_attr'>attr</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::Components (class)">Components</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_name'>component_name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attr'>attr</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_attr_changed_trigger_systems'>attr_changed_trigger_systems</span><span class='lparen'>(</span><span class='id identifier rubyid_attr'>attr</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_equal?'>equal?</span> <span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_attr'>attr</span><span class='rparen'>)</span> <span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attr'>attr</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> @@ -398,7 +398,7 @@ <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::Components (class)">Components</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_name'>component_name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='symbol'>:set_defaults</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='id identifier rubyid_attrs_with_defaults'>attrs_with_defaults</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_attr'>attr</span><span class='comma'>,</span> <span class='id identifier rubyid_default'>default</span><span class='op'>|</span> - <span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attr'>attr</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_default'>default</span><span class='rparen'>)</span> + <span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attr'>attr</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_default'>default</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</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::Components (class)">Components</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_name'>component_name</span><span class='rparen'>)</span> @@ -413,7 +413,7 @@ </div> <div id="footer"> - Generated on Wed Jul 7 01:04:28 2021 by + Generated on Wed Jul 7 17:45:24 2021 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 0d7b483..f789cb3 100644 --- a/docs/FelFlame/Entities.html +++ b/docs/FelFlame/Entities.html @@ -109,9 +109,7 @@ <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></p> - -<p>TODO: Improve Entity overview</p> +<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> </div> @@ -216,30 +214,6 @@ </li> - <li class="public "> - <span class="summary_signature"> - - <a href="#from_json-class_method" title="from_json (class method)">.<strong>from_json</strong>(json_string, **opts) ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Creates a new entity using the data from a JSON string TODO: This function is not yet complete.</p> -</div></span> - -</li> - - </ul> <h2> @@ -276,7 +250,7 @@ <li class="public "> <span class="summary_signature"> - <a href="#components-instance_method" title="#components (instance method)">#<strong>components</strong> ⇒ Hash </a> + <a href="#components-instance_method" title="#components (instance method)">#<strong>components</strong> ⇒ Hash<Component_Manager, Array<Integer>> </a> @@ -291,7 +265,7 @@ <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="Helper/ComponentManager.html#id-instance_method" title="FelFlame::Helper::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 <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> </div></span> </li> @@ -395,30 +369,6 @@ </li> - <li class="public "> - <span class="summary_signature"> - - <a href="#to_json-instance_method" title="#to_json (instance method)">#<strong>to_json</strong> ⇒ String </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Export all data into a JSON String which can then be saved into a file TODO: This function is not yet complete.</p> -</div></span> - -</li> - - </ul> @@ -482,10 +432,7 @@ 23 24 25 -26 -27 -28 -29</pre> +26</pre> </td> <td> <pre class="code"><span class="info file"># File 'entity_manager.rb', line 16</span> @@ -497,9 +444,6 @@ <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='comment'>#components.uniq.each do |component| -</span> <span class='comment'># add component -</span> <span class='comment'>#end </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> @@ -645,12 +589,12 @@ <pre class="lines"> -119 -120 -121</pre> +117 +118 +119</pre> </td> <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 119</span> + <pre class="code"><span class="info file"># File 'entity_manager.rb', line 117</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> @@ -699,12 +643,12 @@ <pre class="lines"> -126 -127 -128</pre> +124 +125 +126</pre> </td> <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 126</span> + <pre class="code"><span class="info file"># File 'entity_manager.rb', line 124</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> @@ -714,79 +658,6 @@ </table> </div> - <div class="method_details "> - <h3 class="signature " id="from_json-class_method"> - - .<strong>from_json</strong>(json_string, **opts) ⇒ <tt>Object</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Creates a new entity using the data from a JSON string TODO: This function is not yet complete</p> - - - </div> -</div> -<div class="tags"> - <p class="tag_title">Parameters:</p> -<ul class="param"> - - <li> - - <span class='name'>json_string</span> - - - <span class='type'>(<tt>String</tt>)</span> - - - - — - <div class='inline'> -<p>A string that was exported originally using the <span class='object_link'><a href="#to_json-instance_method" title="FelFlame::Entities#to_json (method)">to_json</a></span> function</p> -</div> - - </li> - - <li> - - <span class='name'>opts</span> - - - <span class='type'>(<tt>Keywords</tt>)</span> - - - - — - <div class='inline'> -<p>What values(its <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">ID</a></span> or the <span class='object_link'><a href="Helper/ComponentManager.html#id-instance_method" title="FelFlame::Helper::ComponentManager#id (method)">component IDs</a></span>) should be overwritten TODO: this might change</p> -</div> - - </li> - -</ul> - - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -134</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 134</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_from_json'>from_json</span><span class='lparen'>(</span><span class='id identifier rubyid_json_string'>json_string</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - </div> <div id="instance_method_details" class="method_details_list"> @@ -844,7 +715,7 @@ — <div class='inline'> -<p>true if component is added, false if it already is attached or no components given</p> +<p><code>true</code></p> </div> </li> @@ -857,6 +728,9 @@ <pre class="lines"> +58 +59 +60 61 62 63 @@ -867,12 +741,10 @@ 68 69 70 -71 -72 -73</pre> +71</pre> </td> <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 61</span> + <pre class="code"><span class="info file"># File 'entity_manager.rb', line 58</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> @@ -886,6 +758,7 @@ <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> @@ -895,7 +768,7 @@ <div class="method_details "> <h3 class="signature " id="components-instance_method"> - #<strong>components</strong> ⇒ <tt>Hash</tt> + #<strong>components</strong> ⇒ <tt>Hash<Component_Manager, Array<Integer>></tt> @@ -904,7 +777,7 @@ </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="Helper/ComponentManager.html#id-instance_method" title="FelFlame::Helper::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 <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> </div> @@ -917,7 +790,7 @@ <li> - <span class='type'>(<tt>Hash</tt>)</span> + <span class='type'>(<tt>Hash<Component_Manager, Array<Integer>></tt>)</span> @@ -931,12 +804,12 @@ <pre class="lines"> -33 -34 -35</pre> +30 +31 +32</pre> </td> <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 33</span> + <pre class="code"><span class="info file"># File 'entity_manager.rb', line 30</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> @@ -977,7 +850,7 @@ — <div class='inline'> -<p>true.</p> +<p><code>true</code></p> </div> </li> @@ -990,6 +863,9 @@ <pre class="lines"> +42 +43 +44 45 46 47 @@ -998,13 +874,10 @@ 50 51 52 -53 -54 -55 -56</pre> +53</pre> </td> <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 45</span> + <pre class="code"><span class="info file"># File 'entity_manager.rb', line 42</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> @@ -1074,7 +947,7 @@ — <div class='inline'> -<p>true if at least one component is removed, false if none of them were attached to the component</p> +<p><code>true</code></p> </div> </li> @@ -1087,17 +960,17 @@ <pre class="lines"> +88 +89 90 91 92 93 94 -95 -96 -97</pre> +95</pre> </td> <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 90</span> + <pre class="code"><span class="info file"># File 'entity_manager.rb', line 88</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> @@ -1151,12 +1024,12 @@ <pre class="lines"> -39 -40 -41</pre> +36 +37 +38</pre> </td> <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 39</span> + <pre class="code"><span class="info file"># File '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> @@ -1166,67 +1039,12 @@ </table> </div> - <div class="method_details "> - <h3 class="signature " id="to_json-instance_method"> - - #<strong>to_json</strong> ⇒ <tt>String</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Export all data into a JSON String which can then be saved into a file TODO: This function is not yet complete</p> - - - </div> -</div> -<div class="tags"> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>String</tt>)</span> - - - - — - <div class='inline'> -<p>A JSON formatted String</p> -</div> - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -102</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 102</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_to_json'>to_json</span><span class='lparen'>(</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - </div> </div> <div id="footer"> - Generated on Wed Jul 7 01:04:28 2021 by + Generated on Wed Jul 7 17:45:24 2021 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/Helper.html b/docs/FelFlame/Helper.html index da17761..acb3005 100644 --- a/docs/FelFlame/Helper.html +++ b/docs/FelFlame/Helper.html @@ -132,7 +132,7 @@ </div> <div id="footer"> - Generated on Wed Jul 7 01:04:28 2021 by + Generated on Wed Jul 7 12:27:30 2021 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/Helper/ComponentManager.html b/docs/FelFlame/Helper/ComponentManager.html index 0d4d93a..1a04d45 100644 --- a/docs/FelFlame/Helper/ComponentManager.html +++ b/docs/FelFlame/Helper/ComponentManager.html @@ -398,7 +398,7 @@ <li class="public "> <span class="summary_signature"> - <a href="#attr_changed_trigger_systems-instance_method" title="#attr_changed_trigger_systems (instance method)">#<strong>attr_changed_trigger_systems</strong>(attr) ⇒ Object </a> + <a href="#attr_changed_trigger_systems-instance_method" title="#attr_changed_trigger_systems (instance method)">#<strong>attr_changed_trigger_systems</strong>(attr) ⇒ Boolean </a> @@ -422,7 +422,7 @@ <li class="public "> <span class="summary_signature"> - <a href="#attrs-instance_method" title="#attrs (instance method)">#<strong>attrs</strong> ⇒ Hash </a> + <a href="#attrs-instance_method" title="#attrs (instance method)">#<strong>attrs</strong> ⇒ Hash<Symbol, Value> </a> @@ -544,31 +544,7 @@ <li class="public "> <span class="summary_signature"> - <a href="#to_json-instance_method" title="#to_json (instance method)">#<strong>to_json</strong> ⇒ String </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Export all data into a JSON String, which could then later be loaded or saved to a file TODO: This function is not yet complete.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#update_attrs-instance_method" title="#update_attrs (instance method)">#<strong>update_attrs</strong>(**opts) ⇒ Object </a> + <a href="#update_attrs-instance_method" title="#update_attrs (instance method)">#<strong>update_attrs</strong>(**opts) ⇒ Hash<Symbol, Value> </a> @@ -1243,7 +1219,7 @@ <div class="method_details first"> <h3 class="signature first" id="attr_changed_trigger_systems-instance_method"> - #<strong>attr_changed_trigger_systems</strong>(attr) ⇒ <tt>Object</tt> + #<strong>attr_changed_trigger_systems</strong>(attr) ⇒ <tt>Boolean</tt> @@ -1259,6 +1235,24 @@ </div> <div class="tags"> +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Boolean</tt>)</span> + + + + — + <div class='inline'> +<p><code>true</code></p> +</div> + + </li> + +</ul> </div><table class="source_code"> <tr> @@ -1266,7 +1260,6 @@ <pre class="lines"> -202 203 204 205 @@ -1275,11 +1268,10 @@ 208 209 210 -211 -212</pre> +211</pre> </td> <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 202</span> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 203</span> <span class='kw'>def</span> <span class='id identifier rubyid_attr_changed_trigger_systems'>attr_changed_trigger_systems</span><span class='lparen'>(</span><span class='id identifier rubyid_attr'>attr</span><span class='rparen'>)</span> <span class='id identifier rubyid_systems_to_execute'>systems_to_execute</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_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span> @@ -1288,10 +1280,8 @@ <span class='id identifier rubyid_systems_to_execute'>systems_to_execute</span> <span class='op'>|=</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span> <span class='kw'>unless</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='id identifier rubyid_systems_to_execute'>systems_to_execute</span><span class='period'>.</span><span class='id identifier rubyid_sort_by'>sort_by</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:priority</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_reverse'>reverse</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:call</span><span class='rparen'>)</span> - <span class='comment'>#self.attr_triggers.each do |system| -</span> <span class='comment'># systems_to_execute |= [system] -</span> <span class='comment'>#end -</span><span class='kw'>end</span></pre> + <span class='kw'>true</span> +<span class='kw'>end</span></pre> </td> </tr> </table> @@ -1300,7 +1290,7 @@ <div class="method_details "> <h3 class="signature " id="attrs-instance_method"> - #<strong>attrs</strong> ⇒ <tt>Hash</tt> + #<strong>attrs</strong> ⇒ <tt>Hash<Symbol, Value></tt> @@ -1322,7 +1312,7 @@ <li> - <span class='type'>(<tt>Hash</tt>)</span> + <span class='type'>(<tt>Hash<Symbol, Value></tt>)</span> @@ -1341,16 +1331,16 @@ <pre class="lines"> +234 235 236 237 238 239 -240 -241</pre> +240</pre> </td> <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 235</span> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 234</span> <span class='kw'>def</span> <span class='id identifier rubyid_attrs'>attrs</span> <span class='id identifier rubyid_return_hash'>return_hash</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_variables'>instance_variables</span><span class='period'>.</span><span class='id identifier rubyid_each_with_object'>each_with_object</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_final'>final</span><span class='op'>|</span> @@ -1395,7 +1385,7 @@ — <div class='inline'> -<p>true.</p> +<p><code>true</code>.</p> </div> </li> @@ -1408,6 +1398,7 @@ <pre class="lines"> +215 216 217 218 @@ -1423,11 +1414,10 @@ 228 229 230 -231 -232</pre> +231</pre> </td> <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 216</span> + <pre class="code"><span class="info file"># File 'component_manager.rb', line 215</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_addition_triggers'>addition_triggers</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_system'>system</span><span class='op'>|</span> @@ -1560,68 +1550,9 @@ </div> <div class="method_details "> - <h3 class="signature " id="to_json-instance_method"> - - #<strong>to_json</strong> ⇒ <tt>String</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Export all data into a JSON String, which could then later be loaded or saved to a file TODO: This function is not yet complete</p> - - - </div> -</div> -<div class="tags"> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>String</tt>)</span> - - - - — - <div class='inline'> -<p>a JSON formatted String</p> -</div> - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -246 -247 -248</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 246</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_to_json'>to_json</span> - <span class='comment'># should return a json or hash of all data in this component -</span><span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - <div class="method_details "> <h3 class="signature " id="update_attrs-instance_method"> - #<strong>update_attrs</strong>(**opts) ⇒ <tt>Object</tt> + #<strong>update_attrs</strong>(**opts) ⇒ <tt>Hash<Symbol, Value></tt> @@ -1643,11 +1574,11 @@ <li> - <span class='type'></span> + <span class='type'>(<tt>Hash<Symbol, Value></tt>)</span> - + — <div class='inline'> <p>Hash of updated attributes</p> </div> @@ -1686,7 +1617,7 @@ </div> <div id="footer"> - Generated on Wed Jul 7 01:04:28 2021 by + Generated on Wed Jul 7 12:27:30 2021 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 new file mode 100644 index 0000000..00252ed --- /dev/null +++ b/docs/FelFlame/Scenes.html @@ -0,0 +1,761 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> +<title> + Class: FelFlame::Scenes + + — Documentation by YARD 0.9.26 + +</title> + + <link rel="stylesheet" href="../css/style.css" type="text/css" /> + + <link rel="stylesheet" href="../css/common.css" type="text/css" /> + +<script type="text/javascript"> + pathId = "FelFlame::Scenes"; + relpath = '../'; +</script> + + + <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script> + + <script type="text/javascript" charset="utf-8" src="../js/app.js"></script> + + + </head> + <body> + <div class="nav_wrap"> + <iframe id="nav" src="../class_list.html?1"></iframe> + <div id="resizer"></div> + </div> + + <div id="main" tabindex="-1"> + <div id="header"> + <div id="menu"> + + <a href="../_index.html">Index (S)</a> » + <span class='title'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span> + » + <span class="title">Scenes</span> + +</div> + + <div id="search"> + + <a class="full_list_link" id="class_list_link" + href="../class_list.html"> + + <svg width="24" height="24"> + <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect> + <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect> + <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect> + </svg> + </a> + +</div> + <div class="clear"></div> + </div> + + <div id="content"><h1>Class: FelFlame::Scenes + + + +</h1> +<div class="box_info"> + + <dl> + <dt>Inherits:</dt> + <dd> + <span class="inheritName">Object</span> + + <ul class="fullTree"> + <li>Object</li> + + <li class="next">FelFlame::Scenes</li> + + </ul> + <a href="#" class="inheritanceTree">show all</a> + + </dd> + </dl> + + + + + + + + + + + + <dl> + <dt>Defined in:</dt> + <dd>felflame.rb<span class="defines">,<br /> + scene_manager.rb</span> +</dd> + </dl> + +</div> + +<h2>Overview</h2><div class="docstring"> + <div class="discussion"> + +<p>Creates and manages Scenes. Scenes are collections of Systems, and execute all the Systems when called upon.</p> + +<p>TODO: Improve Scenes overview</p> + + + </div> +</div> +<div class="tags"> + + +</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="#const_name-instance_method" title="#const_name (instance method)">#<strong>const_name</strong> ⇒ Object </a> + + + + </span> + + + + + <span class="note title readonly">readonly</span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>The Constant name assigned to this Scene.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#systems-instance_method" title="#systems (instance method)">#<strong>systems</strong> ⇒ Array<System> </a> + + + + </span> + + + + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>The list of Systems this Scene contains.</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>(*systems_to_add) ⇒ Boolean </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Adds any number of Systems to this Scene.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#call-instance_method" title="#call (instance method)">#<strong>call</strong> ⇒ Boolean </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Execute all systems in this Scene, in the order of their priority.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#clear-instance_method" title="#clear (instance method)">#<strong>clear</strong> ⇒ Boolean </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Removes all Systems from this Scene.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(name) ⇒ Scenes </a> + + + + </span> + + + <span class="note title constructor">constructor</span> + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Create a new Scene using the name given.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#remove-instance_method" title="#remove (instance method)">#<strong>remove</strong>(*systems_to_remove) ⇒ Boolean </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Removes any number of SystemS from this Scene.</p> +</div></span> + +</li> + + + </ul> + + +<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"> + + #<strong>initialize</strong>(name) ⇒ <tt><span class='object_link'><a href="" title="FelFlame::Scenes (class)">Scenes</a></span></tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Create a new Scene using the name given</p> + + + </div> +</div> +<div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + + <li> + + <span class='name'>name</span> + + + <span class='type'>(<tt>String</tt>)</span> + + + + — + <div class='inline'> +<p>String format must follow requirements of a constant</p> +</div> + + </li> + +</ul> + + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +10 +11 +12 +13</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'scene_manager.rb', line 10</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</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::Scenes (class)">Scenes</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_set'>const_set</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='kw'>self</span><span class='rparen'>)</span> + <span class='ivar'>@const_name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</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=""></span> + <div class="method_details first"> + <h3 class="signature first" id="const_name-instance_method"> + + #<strong>const_name</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>The Constant name assigned to this Scene</p> + + + </div> +</div> +<div class="tags"> + + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +4 +5 +6</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'scene_manager.rb', line 4</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_const_name'>const_name</span> + <span class='ivar'>@const_name</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + + <span id="systems=-instance_method"></span> + <div class="method_details "> + <h3 class="signature " id="systems-instance_method"> + + #<strong>systems</strong> ⇒ <tt>Array<System></tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>The list of Systems this Scene contains</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Array<System></tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +17 +18 +19</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'scene_manager.rb', line 17</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_systems'>systems</span> + <span class='ivar'>@systems</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + </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>(*systems_to_add) ⇒ <tt>Boolean</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Adds any number of Systems to this Scene</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Boolean</tt>)</span> + + + + — + <div class='inline'> +<p><code>true</code></p> +</div> + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +30 +31 +32 +33 +34 +35</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'scene_manager.rb', line 30</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_systems_to_add'>systems_to_add</span><span class='rparen'>)</span> + <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_systems'>systems</span> <span class='op'>|=</span> <span class='id identifier rubyid_systems_to_add'>systems_to_add</span> + <span class='id identifier rubyid_systems'>systems</span><span class='period'>.</span><span class='id identifier rubyid_sort_by!'>sort_by!</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:priority</span><span class='rparen'>)</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="Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_update_systems_list'>update_systems_list</span> <span class='kw'>if</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="Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_scenes'><span class='object_link'><a href="Stage.html#scenes-class_method" title="FelFlame::Stage.scenes (method)">scenes</a></span></span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='kw'>self</span> + <span class='kw'>true</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="call-instance_method"> + + #<strong>call</strong> ⇒ <tt>Boolean</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Execute all systems in this Scene, in the order of their priority</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Boolean</tt>)</span> + + + + — + <div class='inline'> +<p><code>true</code></p> +</div> + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +23 +24 +25 +26</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'scene_manager.rb', line 23</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span> + <span class='id identifier rubyid_systems'>systems</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:call</span><span class='rparen'>)</span> + <span class='kw'>true</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="clear-instance_method"> + + #<strong>clear</strong> ⇒ <tt>Boolean</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Removes all Systems from this Scene</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Boolean</tt>)</span> + + + + — + <div class='inline'> +<p><code>true</code></p> +</div> + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +48 +49 +50 +51 +52</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'scene_manager.rb', line 48</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_clear'>clear</span> + <span class='id identifier rubyid_systems'>systems</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</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="Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_update_systems_list'>update_systems_list</span> <span class='kw'>if</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="Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_scenes'><span class='object_link'><a href="Stage.html#scenes-class_method" title="FelFlame::Stage.scenes (method)">scenes</a></span></span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='kw'>self</span> + <span class='kw'>true</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="remove-instance_method"> + + #<strong>remove</strong>(*systems_to_remove) ⇒ <tt>Boolean</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Removes any number of SystemS from this Scene</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Boolean</tt>)</span> + + + + — + <div class='inline'> +<p><code>true</code></p> +</div> + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +39 +40 +41 +42 +43 +44</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'scene_manager.rb', line 39</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_systems_to_remove'>systems_to_remove</span><span class='rparen'>)</span> + <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_systems'>systems</span> <span class='op'>-=</span> <span class='id identifier rubyid_systems_to_remove'>systems_to_remove</span> + <span class='id identifier rubyid_systems'>systems</span><span class='period'>.</span><span class='id identifier rubyid_sort_by!'>sort_by!</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:priority</span><span class='rparen'>)</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="Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_update_systems_list'>update_systems_list</span> <span class='kw'>if</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="Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_scenes'><span class='object_link'><a href="Stage.html#scenes-class_method" title="FelFlame::Stage.scenes (method)">scenes</a></span></span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='kw'>self</span> + <span class='kw'>true</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + </div> + +</div> + + <div id="footer"> + Generated on Wed Jul 7 17:45:24 2021 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> + </body> +</html>
\ No newline at end of file diff --git a/docs/FelFlame/Stage.html b/docs/FelFlame/Stage.html new file mode 100644 index 0000000..1027477 --- /dev/null +++ b/docs/FelFlame/Stage.html @@ -0,0 +1,598 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> +<title> + Class: FelFlame::Stage + + — Documentation by YARD 0.9.26 + +</title> + + <link rel="stylesheet" href="../css/style.css" type="text/css" /> + + <link rel="stylesheet" href="../css/common.css" type="text/css" /> + +<script type="text/javascript"> + pathId = "FelFlame::Stage"; + relpath = '../'; +</script> + + + <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script> + + <script type="text/javascript" charset="utf-8" src="../js/app.js"></script> + + + </head> + <body> + <div class="nav_wrap"> + <iframe id="nav" src="../class_list.html?1"></iframe> + <div id="resizer"></div> + </div> + + <div id="main" tabindex="-1"> + <div id="header"> + <div id="menu"> + + <a href="../_index.html">Index (S)</a> » + <span class='title'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span> + » + <span class="title">Stage</span> + +</div> + + <div id="search"> + + <a class="full_list_link" id="class_list_link" + href="../class_list.html"> + + <svg width="24" height="24"> + <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect> + <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect> + <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect> + </svg> + </a> + +</div> + <div class="clear"></div> + </div> + + <div id="content"><h1>Class: FelFlame::Stage + + + +</h1> +<div class="box_info"> + + <dl> + <dt>Inherits:</dt> + <dd> + <span class="inheritName">Object</span> + + <ul class="fullTree"> + <li>Object</li> + + <li class="next">FelFlame::Stage</li> + + </ul> + <a href="#" class="inheritanceTree">show all</a> + + </dd> + </dl> + + + + + + + + + + + + <dl> + <dt>Defined in:</dt> + <dd>felflame.rb<span class="defines">,<br /> + stage_manager.rb</span> +</dd> + </dl> + +</div> + +<h2>Overview</h2><div class="docstring"> + <div class="discussion"> + +<p>Stores Scenes which you want to execute on each frame. When called upon will execute all Systems in the Scenes in the Stage and will execute them according to their priority order.</p> + + + </div> +</div> +<div class="tags"> + + +</div> + + + + <h2>Class Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2> + <ul class="summary"> + + <li class="public "> + <span class="summary_signature"> + + <a href="#scenes-class_method" title="scenes (class method)">.<strong>scenes</strong> ⇒ Array<Scene> </a> + + + + </span> + + + + + <span class="note title readonly">readonly</span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Contains all the Scenes added to the Stage.</p> +</div></span> + +</li> + + + </ul> + + + + + + <h2> + Class 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-class_method" title="add (class method)">.<strong>add</strong>(*scenes_to_add) ⇒ Boolean </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Add any number of Scenes to the Stage.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#call-class_method" title="call (class method)">.<strong>call</strong> ⇒ Boolean </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Executes one frame of the game.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#clear-class_method" title="clear (class method)">.<strong>clear</strong> ⇒ Boolean </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Clears all Scenes that were added to the Stage.</p> +</div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#remove-class_method" title="remove (class method)">.<strong>remove</strong>(*scenes_to_remove) ⇒ Boolean </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'> +<p>Remove any number of Scenes from the Stage.</p> +</div></span> + +</li> + + + </ul> + + + + <div id="class_attr_details" class="attr_details"> + <h2>Class Attribute Details</h2> + + + <span id="scenes=-class_method"></span> + <div class="method_details first"> + <h3 class="signature first" id="scenes-class_method"> + + .<strong>scenes</strong> ⇒ <tt>Array<Scene></tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Contains all the Scenes added to the Stage</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Array<Scene></tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +58 +59 +60</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'stage_manager.rb', line 58</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_scenes'>scenes</span> + <span class='ivar'>@scenes</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</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="add-class_method"> + + .<strong>add</strong>(*scenes_to_add) ⇒ <tt>Boolean</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Add any number of Scenes to the Stage</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Boolean</tt>)</span> + + + + — + <div class='inline'> +<p><code>true</code></p> +</div> + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +11 +12 +13 +14 +15 +16 +17 +18</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'stage_manager.rb', line 11</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_scenes_to_add'>scenes_to_add</span><span class='rparen'>)</span> + <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_scenes'>scenes</span> <span class='op'>|=</span> <span class='id identifier rubyid_scenes_to_add'>scenes_to_add</span> + <span class='id identifier rubyid_scenes_to_add'>scenes_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_scene'>scene</span><span class='op'>|</span> + <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_systems'>systems</span> <span class='op'>|=</span> <span class='id identifier rubyid_scene'>scene</span><span class='period'>.</span><span class='id identifier rubyid_systems'>systems</span> + <span class='kw'>end</span> + <span class='id identifier rubyid_systems'>systems</span><span class='period'>.</span><span class='id identifier rubyid_sort_by!'>sort_by!</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:priority</span><span class='rparen'>)</span> + <span class='kw'>true</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="call-class_method"> + + .<strong>call</strong> ⇒ <tt>Boolean</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Executes one frame of the game. This executes all the Systems in the Scenes added to the Stage. Systems that exist in two or more different Scenes will still only get executed once.</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Boolean</tt>)</span> + + + + — + <div class='inline'> +<p><code>true</code></p> +</div> + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +51 +52 +53 +54</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'stage_manager.rb', line 51</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span> + <span class='id identifier rubyid_systems'>systems</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:call</span><span class='rparen'>)</span> + <span class='kw'>true</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="clear-class_method"> + + .<strong>clear</strong> ⇒ <tt>Boolean</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Clears all Scenes that were added to the Stage</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Boolean</tt>)</span> + + + + — + <div class='inline'> +<p><code>true</code></p> +</div> + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +43 +44 +45 +46 +47</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'stage_manager.rb', line 43</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_clear'>clear</span> + <span class='id identifier rubyid_systems'>systems</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span> + <span class='id identifier rubyid_scenes'>scenes</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span> + <span class='kw'>true</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="remove-class_method"> + + .<strong>remove</strong>(*scenes_to_remove) ⇒ <tt>Boolean</tt> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + +<p>Remove any number of Scenes from the Stage</p> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Boolean</tt>)</span> + + + + — + <div class='inline'> +<p><code>true</code></p> +</div> + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +22 +23 +24 +25 +26</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'stage_manager.rb', line 22</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_scenes_to_remove'>scenes_to_remove</span><span class='rparen'>)</span> + <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_scenes'>scenes</span> <span class='op'>-=</span> <span class='id identifier rubyid_scenes_to_remove'>scenes_to_remove</span> + <span class='id identifier rubyid_update_systems_list'>update_systems_list</span> + <span class='kw'>true</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + </div> + +</div> + + <div id="footer"> + Generated on Wed Jul 7 17:45:24 2021 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> + </body> +</html>
\ No newline at end of file diff --git a/docs/FelFlame/Systems.html b/docs/FelFlame/Systems.html index 1bc342a..3586974 100644 --- a/docs/FelFlame/Systems.html +++ b/docs/FelFlame/Systems.html @@ -109,9 +109,9 @@ <h2>Overview</h2><div class="docstring"> <div class="discussion"> -<p>Creates an manages Systems.</p> +<p>Creates an manages Systems. Systems are the logic of the game and do not contain any data within them.</p> -<p>TODO: Improve System overview</p> +<p>TODO: Improve Systems overview</p> </div> @@ -196,6 +196,8 @@ + <span class="note title readonly">readonly</span> + @@ -438,7 +440,7 @@ <li class="public "> <span class="summary_signature"> - <a href="#trigger_when_is_changed-instance_method" title="#trigger_when_is_changed (instance method)">#<strong>trigger_when_is_changed</strong>(component_or_manager, attr) ⇒ Object </a> + <a href="#trigger_when_is_changed-instance_method" title="#trigger_when_is_changed (instance method)">#<strong>trigger_when_is_changed</strong>(component_or_manager, attr) ⇒ Boolean </a> @@ -584,15 +586,15 @@ <pre class="lines"> -67 -68 -69 -70 71 -72</pre> +72 +73 +74 +75 +76</pre> </td> <td> - <pre class="code"><span class="info file"># File 'system_manager.rb', line 67</span> + <pre class="code"><span class="info file"># File 'system_manager.rb', line 71</span> <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='label'>priority:</span> <span class='int'>0</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</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::Systems (class)">Systems</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_set'>const_set</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='kw'>self</span><span class='rparen'>)</span> @@ -651,12 +653,12 @@ <pre class="lines"> -20 -21 -22</pre> +24 +25 +26</pre> </td> <td> - <pre class="code"><span class="info file"># File 'system_manager.rb', line 20</span> + <pre class="code"><span class="info file"># File 'system_manager.rb', line 24</span> <span class='kw'>def</span> <span class='id identifier rubyid_addition_triggers'>addition_triggers</span> <span class='ivar'>@addition_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> @@ -707,12 +709,12 @@ <pre class="lines"> -38 -39 -40</pre> +42 +43 +44</pre> </td> <td> - <pre class="code"><span class="info file"># File 'system_manager.rb', line 38</span> + <pre class="code"><span class="info file"># File 'system_manager.rb', line 42</span> <span class='kw'>def</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span> <span class='ivar'>@attr_triggers</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> @@ -723,11 +725,11 @@ </div> - <span id="const_name=-instance_method"></span> + <span id=""></span> <div class="method_details "> <h3 class="signature " id="const_name-instance_method"> - #<strong>const_name</strong> ⇒ <tt>Object</tt> + #<strong>const_name</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span> @@ -849,12 +851,12 @@ <pre class="lines"> -29 -30 -31</pre> +33 +34 +35</pre> </td> <td> - <pre class="code"><span class="info file"># File 'system_manager.rb', line 29</span> + <pre class="code"><span class="info file"># File 'system_manager.rb', line 33</span> <span class='kw'>def</span> <span class='id identifier rubyid_removal_triggers'>removal_triggers</span> <span class='ivar'>@removal_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> @@ -910,12 +912,12 @@ <pre class="lines"> -47 -48 -49</pre> +51 +52 +53</pre> </td> <td> - <pre class="code"><span class="info file"># File 'system_manager.rb', line 47</span> + <pre class="code"><span class="info file"># File 'system_manager.rb', line 51</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_constants'>constants</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_sym'>sym</span><span class='op'>|</span> <span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_sym'>sym</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_sort_by'>sort_by</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:priority</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_reverse'>reverse</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> @@ -957,12 +959,12 @@ <pre class="lines"> -75 -76 -77</pre> +79 +80 +81</pre> </td> <td> - <pre class="code"><span class="info file"># File 'system_manager.rb', line 75</span> + <pre class="code"><span class="info file"># File 'system_manager.rb', line 79</span> <span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span> <span class='ivar'>@block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span> @@ -1035,7 +1037,7 @@ <span class='name'>component_or_manager</span> - <span class='type'>(<tt>Component or ComponentManager</tt>)</span> + <span class='type'>(<tt>Component or <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> @@ -1062,7 +1064,7 @@ — <div class='inline'> -<p>true</p> +<p><code>true</code></p> </div> </li> @@ -1075,10 +1077,6 @@ <pre class="lines"> -107 -108 -109 -110 111 112 113 @@ -1143,10 +1141,12 @@ 172 173 174 -175</pre> +175 +176 +177</pre> </td> <td> - <pre class="code"><span class="info file"># File 'system_manager.rb', line 107</span> + <pre class="code"><span class="info file"># File 'system_manager.rb', line 111</span> <span class='kw'>def</span> <span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_trigger_types'>trigger_types</span><span class='comma'>,</span> <span class='label'>component_or_manager:</span> <span class='kw'>nil</span><span class='rparen'>)</span> <span class='id identifier rubyid_trigger_types'>trigger_types</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='symbol'>:addition_triggers</span><span class='comma'>,</span> <span class='symbol'>:removal_triggers</span><span class='comma'>,</span> <span class='symbol'>:attr_triggers</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_trigger_types'>trigger_types</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> @@ -1193,10 +1193,7 @@ </span> <span class='lparen'>(</span><span class='id identifier rubyid_trigger_types'>trigger_types</span> <span class='op'>-</span> <span class='lbracket'>[</span><span class='symbol'>:addition_triggers</span><span class='comma'>,</span> <span class='symbol'>:removal_triggers</span><span class='comma'>,</span> <span class='symbol'>:attr_triggers</span><span class='rbracket'>]</span><span class='rparen'>)</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_attr'>attr</span><span class='op'>|</span> <span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='kw'>self</span> - <span class='comment'>#self.attr_triggers[component_or_manager].each do |attr| -</span> <span class='comment'># component_or_manager.attr_triggers[attr].delete self -</span> <span class='comment'>#end -</span> <span class='kw'>end</span> + <span class='kw'>end</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rbracket'>]</span> <span class='op'>-=</span> <span class='id identifier rubyid_trigger_types'>trigger_types</span> <span class='kw'>unless</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>end</span> @@ -1216,6 +1213,7 @@ <span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_trigger_type'>trigger_type</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='kw'>self</span> <span class='kw'>end</span> <span class='kw'>end</span> + <span class='kw'>true</span> <span class='kw'>end</span></pre> </td> </tr> @@ -1268,12 +1266,12 @@ <pre class="lines"> -80 -81 -82</pre> +84 +85 +86</pre> </td> <td> - <pre class="code"><span class="info file"># File 'system_manager.rb', line 80</span> + <pre class="code"><span class="info file"># File 'system_manager.rb', line 84</span> <span class='kw'>def</span> <span class='id identifier rubyid_redefine'>redefine</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> <span class='ivar'>@block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span> @@ -1309,7 +1307,7 @@ <span class='name'>component_or_manager</span> - <span class='type'>(<tt>Component or ComponentManager</tt>)</span> + <span class='type'>(<tt>Component or <span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span></tt>)</span> @@ -1334,7 +1332,7 @@ — <div class='inline'> -<p>true</p> +<p><code>true</code></p> </div> </li> @@ -1347,14 +1345,14 @@ <pre class="lines"> -180 -181 182 183 -184</pre> +184 +185 +186</pre> </td> <td> - <pre class="code"><span class="info file"># File 'system_manager.rb', line 180</span> + <pre class="code"><span class="info file"># File 'system_manager.rb', line 182</span> <span class='kw'>def</span> <span class='id identifier rubyid_trigger_when_added'>trigger_when_added</span><span class='lparen'>(</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rparen'>)</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_addition_triggers'>addition_triggers</span> <span class='op'>|=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rbracket'>]</span> @@ -1369,7 +1367,7 @@ <div class="method_details "> <h3 class="signature " id="trigger_when_is_changed-instance_method"> - #<strong>trigger_when_is_changed</strong>(component_or_manager, attr) ⇒ <tt>Object</tt> + #<strong>trigger_when_is_changed</strong>(component_or_manager, attr) ⇒ <tt>Boolean</tt> @@ -1385,6 +1383,24 @@ </div> <div class="tags"> +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Boolean</tt>)</span> + + + + — + <div class='inline'> +<p><code>true</code></p> +</div> + + </li> + +</ul> </div><table class="source_code"> <tr> @@ -1392,9 +1408,6 @@ <pre class="lines"> -196 -197 -198 199 200 201 @@ -1403,10 +1416,14 @@ 204 205 206 -207</pre> +207 +208 +209 +210 +211</pre> </td> <td> - <pre class="code"><span class="info file"># File 'system_manager.rb', line 196</span> + <pre class="code"><span class="info file"># File 'system_manager.rb', line 199</span> <span class='kw'>def</span> <span class='id identifier rubyid_trigger_when_is_changed'>trigger_when_is_changed</span><span class='lparen'>(</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='comma'>,</span> <span class='id identifier rubyid_attr'>attr</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> @@ -1419,6 +1436,7 @@ <span class='kw'>else</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rbracket'>]</span> <span class='op'>|=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span> <span class='kw'>end</span> + <span class='kw'>true</span> <span class='kw'>end</span></pre> </td> </tr> @@ -1451,7 +1469,7 @@ <span class='name'>component_or_manager</span> - <span class='type'>(<tt>Component or ComponentManager</tt>)</span> + <span class='type'>(<tt>Component or <span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span></tt>)</span> @@ -1476,7 +1494,7 @@ — <div class='inline'> -<p>true</p> +<p><code>true</code></p> </div> </li> @@ -1489,14 +1507,14 @@ <pre class="lines"> -189 -190 191 192 -193</pre> +193 +194 +195</pre> </td> <td> - <pre class="code"><span class="info file"># File 'system_manager.rb', line 189</span> + <pre class="code"><span class="info file"># File 'system_manager.rb', line 191</span> <span class='kw'>def</span> <span class='id identifier rubyid_trigger_when_removed'>trigger_when_removed</span><span class='lparen'>(</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rparen'>)</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_removal_triggers'>removal_triggers</span> <span class='op'>|=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rbracket'>]</span> @@ -1513,7 +1531,7 @@ </div> <div id="footer"> - Generated on Wed Jul 7 01:04:28 2021 by + Generated on Wed Jul 7 17:45:24 2021 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 db7838b..24ecfff 100644 --- a/docs/_index.html +++ b/docs/_index.html @@ -81,9 +81,9 @@ <ul> <li> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html" title="FelFlame::Helper::ComponentManager (class)">ComponentManager</a></span> + <span class='object_link'><a href="FelFlame/ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span> - <small>(FelFlame::Helper)</small> + <small>(FelFlame)</small> </li> @@ -126,24 +126,23 @@ </ul> - <ul id="alpha_H" class="alpha"> - <li class="letter">H</li> + <ul id="alpha_S" class="alpha"> + <li class="letter">S</li> <ul> <li> - <span class='object_link'><a href="FelFlame/Helper.html" title="FelFlame::Helper (class)">Helper</a></span> + <span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span> <small>(FelFlame)</small> </li> - </ul> - </ul> - - - <ul id="alpha_S" class="alpha"> - <li class="letter">S</li> - <ul> + <li> + <span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span> + + <small>(FelFlame)</small> + + </li> <li> <span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span> @@ -164,7 +163,7 @@ </div> <div id="footer"> - Generated on Wed Jul 7 01:04:28 2021 by + Generated on Wed Jul 7 17:45:24 2021 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/class_list.html b/docs/class_list.html index 63d72d5..fcc39cb 100644 --- a/docs/class_list.html +++ b/docs/class_list.html @@ -43,7 +43,7 @@ <ul id="full_list" class="class"> <li id="object_" class="odd"><div class="item" style="padding-left:30px"><span class='object_link'><a href="top-level-namespace.html" title="Top Level Namespace (root)">Top Level Namespace</a></span></div></li> -<li id='object_FelFlame' class='even'><div class='item' style='padding-left:30px'><a class='toggle'></a> <span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span> < Object<small class='search_info'>Top Level Namespace</small></div><ul><li id='object_FelFlame::Components' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span> < Object<small class='search_info'>FelFlame</small></div></li><li id='object_FelFlame::Entities' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span> < Object<small class='search_info'>FelFlame</small></div></li><li id='object_FelFlame::Helper' class='collapsed odd'><div class='item' style='padding-left:45px'><a class='toggle'></a> <span class='object_link'><a href="FelFlame/Helper.html" title="FelFlame::Helper (class)">Helper</a></span> < Object<small class='search_info'>FelFlame</small></div><ul><li id='object_FelFlame::Helper::ComponentManager' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="FelFlame/Helper/ComponentManager.html" title="FelFlame::Helper::ComponentManager (class)">ComponentManager</a></span> < Object<small class='search_info'>FelFlame::Helper</small></div></li></ul></li><li id='object_FelFlame::Systems' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span> < Object<small class='search_info'>FelFlame</small></div></li></ul></li> +<li id='object_FelFlame' class='even'><div class='item' style='padding-left:30px'><a class='toggle'></a> <span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span> < Object<small class='search_info'>Top Level Namespace</small></div><ul><li id='object_FelFlame::ComponentManager' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="FelFlame/ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span> < Object<small class='search_info'>FelFlame</small></div></li><li id='object_FelFlame::Components' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span> < Object<small class='search_info'>FelFlame</small></div></li><li id='object_FelFlame::Entities' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span> < Object<small class='search_info'>FelFlame</small></div></li><li id='object_FelFlame::Scenes' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span> < Object<small class='search_info'>FelFlame</small></div></li><li id='object_FelFlame::Stage' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span> < Object<small class='search_info'>FelFlame</small></div></li><li id='object_FelFlame::Systems' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span> < Object<small class='search_info'>FelFlame</small></div></li></ul></li> </ul> </div> diff --git a/docs/file.README.html b/docs/file.README.html index 7e811f1..ca7e97f 100644 --- a/docs/file.README.html +++ b/docs/file.README.html @@ -90,8 +90,8 @@ I plan to eventually add functionality outside of just ECS such as loading tiles <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span> <span class='op'>=</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="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span></span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span> <span class='op'>=</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="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span> <span class='op'>=</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="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span> -<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sce</span> <span class='op'>=</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'>Scenes</span> -<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span> <span class='op'>=</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'>Stage</span> +<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sce</span> <span class='op'>=</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="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span> +<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span> <span class='op'>=</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="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span> </code></pre> <h2 id="classes">Classes:</h2> @@ -373,7 +373,7 @@ complete I will use a more verbose explanation as below to help users of the fra </div></div> <div id="footer"> - Generated on Wed Jul 7 01:04:28 2021 by + Generated on Wed Jul 7 17:45:24 2021 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 3326748..1f59c82 100644 --- a/docs/index.html +++ b/docs/index.html @@ -90,8 +90,8 @@ I plan to eventually add functionality outside of just ECS such as loading tiles <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span> <span class='op'>=</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="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span></span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span> <span class='op'>=</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="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span> <span class='op'>=</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="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span> -<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sce</span> <span class='op'>=</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'>Scenes</span> -<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span> <span class='op'>=</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'>Stage</span> +<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sce</span> <span class='op'>=</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="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span> +<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span> <span class='op'>=</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="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span> </code></pre> <h2 id="classes">Classes:</h2> @@ -373,7 +373,7 @@ complete I will use a more verbose explanation as below to help users of the fra </div></div> <div id="footer"> - Generated on Wed Jul 7 01:04:28 2021 by + Generated on Wed Jul 7 17:45:24 2021 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/method_list.html b/docs/method_list.html index 31380fe..d8804ef 100644 --- a/docs/method_list.html +++ b/docs/method_list.html @@ -46,8 +46,8 @@ <li class="odd "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#[]-class_method" title="FelFlame::Helper::ComponentManager.[] (method)">[]</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/ComponentManager.html#[]-class_method" title="FelFlame::ComponentManager.[] (method)">[]</a></span> + <small>FelFlame::ComponentManager</small> </div> </li> @@ -70,6 +70,22 @@ <li class="even "> <div class="item"> + <span class='object_link'><a href="FelFlame/Scenes.html#add-instance_method" title="FelFlame::Scenes#add (method)">#add</a></span> + <small>FelFlame::Scenes</small> + </div> + </li> + + + <li class="odd "> + <div class="item"> + <span class='object_link'><a href="FelFlame/Stage.html#add-class_method" title="FelFlame::Stage.add (method)">add</a></span> + <small>FelFlame::Stage</small> + </div> + </li> + + + <li class="even "> + <div class="item"> <span class='object_link'><a href="FelFlame/Systems.html#addition_triggers-instance_method" title="FelFlame::Systems#addition_triggers (method)">#addition_triggers</a></span> <small>FelFlame::Systems</small> </div> @@ -78,24 +94,24 @@ <li class="odd "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#addition_triggers-instance_method" title="FelFlame::Helper::ComponentManager#addition_triggers (method)">#addition_triggers</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/ComponentManager.html#addition_triggers-instance_method" title="FelFlame::ComponentManager#addition_triggers (method)">#addition_triggers</a></span> + <small>FelFlame::ComponentManager</small> </div> </li> <li class="even "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#addition_triggers-class_method" title="FelFlame::Helper::ComponentManager.addition_triggers (method)">addition_triggers</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/ComponentManager.html#addition_triggers-class_method" title="FelFlame::ComponentManager.addition_triggers (method)">addition_triggers</a></span> + <small>FelFlame::ComponentManager</small> </div> </li> <li class="odd "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#attr_changed_trigger_systems-instance_method" title="FelFlame::Helper::ComponentManager#attr_changed_trigger_systems (method)">#attr_changed_trigger_systems</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/ComponentManager.html#attr_changed_trigger_systems-instance_method" title="FelFlame::ComponentManager#attr_changed_trigger_systems (method)">#attr_changed_trigger_systems</a></span> + <small>FelFlame::ComponentManager</small> </div> </li> @@ -110,24 +126,24 @@ <li class="odd "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#attr_triggers-instance_method" title="FelFlame::Helper::ComponentManager#attr_triggers (method)">#attr_triggers</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/ComponentManager.html#attr_triggers-instance_method" title="FelFlame::ComponentManager#attr_triggers (method)">#attr_triggers</a></span> + <small>FelFlame::ComponentManager</small> </div> </li> <li class="even "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#attr_triggers-class_method" title="FelFlame::Helper::ComponentManager.attr_triggers (method)">attr_triggers</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/ComponentManager.html#attr_triggers-class_method" title="FelFlame::ComponentManager.attr_triggers (method)">attr_triggers</a></span> + <small>FelFlame::ComponentManager</small> </div> </li> <li class="odd "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#attrs-instance_method" title="FelFlame::Helper::ComponentManager#attrs (method)">#attrs</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/ComponentManager.html#attrs-instance_method" title="FelFlame::ComponentManager#attrs (method)">#attrs</a></span> + <small>FelFlame::ComponentManager</small> </div> </li> @@ -142,13 +158,53 @@ <li class="odd "> <div class="item"> + <span class='object_link'><a href="FelFlame/Scenes.html#call-instance_method" title="FelFlame::Scenes#call (method)">#call</a></span> + <small>FelFlame::Scenes</small> + </div> + </li> + + + <li class="even "> + <div class="item"> + <span class='object_link'><a href="FelFlame/Stage.html#call-class_method" title="FelFlame::Stage.call (method)">call</a></span> + <small>FelFlame::Stage</small> + </div> + </li> + + + <li class="odd "> + <div class="item"> + <span class='object_link'><a href="FelFlame.html#call-class_method" title="FelFlame.call (method)">call</a></span> + <small>FelFlame</small> + </div> + </li> + + + <li class="even "> + <div class="item"> + <span class='object_link'><a href="FelFlame/Scenes.html#clear-instance_method" title="FelFlame::Scenes#clear (method)">#clear</a></span> + <small>FelFlame::Scenes</small> + </div> + </li> + + + <li class="odd "> + <div class="item"> + <span class='object_link'><a href="FelFlame/Stage.html#clear-class_method" title="FelFlame::Stage.clear (method)">clear</a></span> + <small>FelFlame::Stage</small> + </div> + </li> + + + <li class="even "> + <div class="item"> <span class='object_link'><a href="FelFlame/Systems.html#clear_triggers-instance_method" title="FelFlame::Systems#clear_triggers (method)">#clear_triggers</a></span> <small>FelFlame::Systems</small> </div> </li> - <li class="even "> + <li class="odd "> <div class="item"> <span class='object_link'><a href="FelFlame/Entities.html#components-instance_method" title="FelFlame::Entities#components (method)">#components</a></span> <small>FelFlame::Entities</small> @@ -156,7 +212,7 @@ </li> - <li class="odd "> + <li class="even "> <div class="item"> <span class='object_link'><a href="FelFlame/Systems.html#const_name-instance_method" title="FelFlame::Systems#const_name (method)">#const_name</a></span> <small>FelFlame::Systems</small> @@ -164,10 +220,18 @@ </li> + <li class="odd "> + <div class="item"> + <span class='object_link'><a href="FelFlame/Scenes.html#const_name-instance_method" title="FelFlame::Scenes#const_name (method)">#const_name</a></span> + <small>FelFlame::Scenes</small> + </div> + </li> + + <li class="even "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#delete-instance_method" title="FelFlame::Helper::ComponentManager#delete (method)">#delete</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/ComponentManager.html#delete-instance_method" title="FelFlame::ComponentManager#delete (method)">#delete</a></span> + <small>FelFlame::ComponentManager</small> </div> </li> @@ -198,8 +262,8 @@ <li class="even "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#each-class_method" title="FelFlame::Helper::ComponentManager.each (method)">each</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/ComponentManager.html#each-class_method" title="FelFlame::ComponentManager.each (method)">each</a></span> + <small>FelFlame::ComponentManager</small> </div> </li> @@ -214,56 +278,56 @@ <li class="even "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#entities-instance_method" title="FelFlame::Helper::ComponentManager#entities (method)">#entities</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/ComponentManager.html#entities-instance_method" title="FelFlame::ComponentManager#entities (method)">#entities</a></span> + <small>FelFlame::ComponentManager</small> </div> </li> <li class="odd "> <div class="item"> - <span class='object_link'><a href="FelFlame/Entities.html#from_json-class_method" title="FelFlame::Entities.from_json (method)">from_json</a></span> - <small>FelFlame::Entities</small> + <span class='object_link'><a href="FelFlame/ComponentManager.html#id-instance_method" title="FelFlame::ComponentManager#id (method)">#id</a></span> + <small>FelFlame::ComponentManager</small> </div> </li> <li class="even "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#id-instance_method" title="FelFlame::Helper::ComponentManager#id (method)">#id</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/Entities.html#id-instance_method" title="FelFlame::Entities#id (method)">#id</a></span> + <small>FelFlame::Entities</small> </div> </li> <li class="odd "> <div class="item"> - <span class='object_link'><a href="FelFlame/Entities.html#id-instance_method" title="FelFlame::Entities#id (method)">#id</a></span> - <small>FelFlame::Entities</small> + <span class='object_link'><a href="FelFlame/Systems.html#initialize-instance_method" title="FelFlame::Systems#initialize (method)">#initialize</a></span> + <small>FelFlame::Systems</small> </div> </li> <li class="even "> <div class="item"> - <span class='object_link'><a href="FelFlame/Systems.html#initialize-instance_method" title="FelFlame::Systems#initialize (method)">#initialize</a></span> - <small>FelFlame::Systems</small> + <span class='object_link'><a href="FelFlame/ComponentManager.html#initialize-instance_method" title="FelFlame::ComponentManager#initialize (method)">#initialize</a></span> + <small>FelFlame::ComponentManager</small> </div> </li> <li class="odd "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#initialize-instance_method" title="FelFlame::Helper::ComponentManager#initialize (method)">#initialize</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/Entities.html#initialize-instance_method" title="FelFlame::Entities#initialize (method)">#initialize</a></span> + <small>FelFlame::Entities</small> </div> </li> <li class="even "> <div class="item"> - <span class='object_link'><a href="FelFlame/Entities.html#initialize-instance_method" title="FelFlame::Entities#initialize (method)">#initialize</a></span> - <small>FelFlame::Entities</small> + <span class='object_link'><a href="FelFlame/Scenes.html#initialize-instance_method" title="FelFlame::Scenes#initialize (method)">#initialize</a></span> + <small>FelFlame::Scenes</small> </div> </li> @@ -302,16 +366,16 @@ <li class="odd "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#removal_triggers-instance_method" title="FelFlame::Helper::ComponentManager#removal_triggers (method)">#removal_triggers</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/ComponentManager.html#removal_triggers-instance_method" title="FelFlame::ComponentManager#removal_triggers (method)">#removal_triggers</a></span> + <small>FelFlame::ComponentManager</small> </div> </li> <li class="even "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#removal_triggers-class_method" title="FelFlame::Helper::ComponentManager.removal_triggers (method)">removal_triggers</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/ComponentManager.html#removal_triggers-class_method" title="FelFlame::ComponentManager.removal_triggers (method)">removal_triggers</a></span> + <small>FelFlame::ComponentManager</small> </div> </li> @@ -326,31 +390,47 @@ <li class="even "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#to_i-instance_method" title="FelFlame::Helper::ComponentManager#to_i (method)">#to_i</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/Scenes.html#remove-instance_method" title="FelFlame::Scenes#remove (method)">#remove</a></span> + <small>FelFlame::Scenes</small> </div> </li> <li class="odd "> <div class="item"> - <span class='object_link'><a href="FelFlame/Entities.html#to_i-instance_method" title="FelFlame::Entities#to_i (method)">#to_i</a></span> - <small>FelFlame::Entities</small> + <span class='object_link'><a href="FelFlame/Stage.html#remove-class_method" title="FelFlame::Stage.remove (method)">remove</a></span> + <small>FelFlame::Stage</small> + </div> + </li> + + + <li class="even "> + <div class="item"> + <span class='object_link'><a href="FelFlame/Stage.html#scenes-class_method" title="FelFlame::Stage.scenes (method)">scenes</a></span> + <small>FelFlame::Stage</small> + </div> + </li> + + + <li class="odd "> + <div class="item"> + <span class='object_link'><a href="FelFlame/Scenes.html#systems-instance_method" title="FelFlame::Scenes#systems (method)">#systems</a></span> + <small>FelFlame::Scenes</small> </div> </li> <li class="even "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#to_json-instance_method" title="FelFlame::Helper::ComponentManager#to_json (method)">#to_json</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/ComponentManager.html#to_i-instance_method" title="FelFlame::ComponentManager#to_i (method)">#to_i</a></span> + <small>FelFlame::ComponentManager</small> </div> </li> <li class="odd "> <div class="item"> - <span class='object_link'><a href="FelFlame/Entities.html#to_json-instance_method" title="FelFlame::Entities#to_json (method)">#to_json</a></span> + <span class='object_link'><a href="FelFlame/Entities.html#to_i-instance_method" title="FelFlame::Entities#to_i (method)">#to_i</a></span> <small>FelFlame::Entities</small> </div> </li> @@ -382,8 +462,8 @@ <li class="odd "> <div class="item"> - <span class='object_link'><a href="FelFlame/Helper/ComponentManager.html#update_attrs-instance_method" title="FelFlame::Helper::ComponentManager#update_attrs (method)">#update_attrs</a></span> - <small>FelFlame::Helper::ComponentManager</small> + <span class='object_link'><a href="FelFlame/ComponentManager.html#update_attrs-instance_method" title="FelFlame::ComponentManager#update_attrs (method)">#update_attrs</a></span> + <small>FelFlame::ComponentManager</small> </div> </li> diff --git a/docs/top-level-namespace.html b/docs/top-level-namespace.html index acb7f53..aeb94c7 100644 --- a/docs/top-level-namespace.html +++ b/docs/top-level-namespace.html @@ -127,7 +127,7 @@ </div> <div id="footer"> - Generated on Wed Jul 7 01:04:28 2021 by + Generated on Wed Jul 7 17:45:24 2021 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/entity_manager.rb b/entity_manager.rb index efa685f..74fc4c3 100644 --- a/entity_manager.rb +++ b/entity_manager.rb @@ -20,16 +20,13 @@ class FelFlame self.id = new_id # Add each component - #components.uniq.each do |component| - # add component - #end add(*components) self.class.data[id] = self end - # A hash that uses component manager constant names as keys, and where the values of those keys are arrays that contain the {FelFlame::Helper::ComponentManager#id IDs} of the components attached to this entity. - # @return [Hash] + # A hash that uses component manager constant names as keys, and where the values of those keys are arrays that contain the {FelFlame::ComponentManager#id IDs} of the components attached to this entity. + # @return [Hash<Component_Manager, Array<Integer>>] def components @components ||= {} end @@ -41,7 +38,7 @@ class FelFlame end # Removes this Entity from the list and purges all references to this Entity from other Components, as well as its {id ID} and data. - # @return [Boolean] true. + # @return [Boolean] +true+ def delete components.each do |component_manager, component_array| component_array.each do |component_id| @@ -57,7 +54,7 @@ class FelFlame # Add any number components to the Entity. # @param components_to_add [Component] Any number of components created from any component manager - # @return [Boolean] true if component is added, false if it already is attached or no components given + # @return [Boolean] +true+ def add(*components_to_add) components_to_add.each do |component| if components[component.class].nil? @@ -70,10 +67,11 @@ class FelFlame check_systems component, :addition_triggers end end + true end # triggers every system associated with this component's trigger - # @return [Boolean] true + # @return [Boolean] +true+ # @!visibility private def check_systems(component, trigger_type) component_calls = component.class.send(trigger_type) @@ -86,7 +84,7 @@ class FelFlame # Remove a component from the Entity # @param components_to_remove [Component] A component created from any component manager - # @return [Boolean] true if at least one component is removed, false if none of them were attached to the component + # @return [Boolean] +true+ def remove(*components_to_remove) components_to_remove.each do |component| check_systems component, :removal_triggers if component.entities.include? id @@ -99,7 +97,7 @@ class FelFlame # Export all data into a JSON String which can then be saved into a file # TODO: This function is not yet complete # @return [String] A JSON formatted String - def to_json() end + #def to_json() end class <<self include Enumerable @@ -130,8 +128,8 @@ class FelFlame # Creates a new entity using the data from a JSON string # TODO: This function is not yet complete # @param json_string [String] A string that was exported originally using the {FelFlame::Entities#to_json to_json} function - # @param opts [Keywords] What values(its {FelFlame::Entities#id ID} or the {FelFlame::Helper::ComponentManager#id component IDs}) should be overwritten TODO: this might change - def from_json(json_string, **opts) end + # @param opts [Keywords] What values(its {FelFlame::Entities#id ID} or the {FelFlame::ComponentManager#id component IDs}) should be overwritten TODO: this might change + #def from_json(json_string, **opts) end end end end diff --git a/felflame.rb b/felflame.rb index 005cfcb..7ed7897 100644 --- a/felflame.rb +++ b/felflame.rb @@ -1,26 +1,41 @@ -require_relative './entity_manager.rb' -require_relative './component_manager.rb' -require_relative './system_manager.rb' -require_relative './scene_manager.rb' -require_relative './stage_manager.rb' +require_relative './entity_manager' +require_relative './component_manager' +require_relative './system_manager' +require_relative './scene_manager' +require_relative './stage_manager' +# The FelFlame namespace where all its functionality resides under. class FelFlame - # Creates and manages Entities. Allows accessing Entities using their {FelFlame::Entities#id ID} - # - # TODO: Improve Entity overview + class <<self + # :nocov: + + # An alias for {FelFlame::Stage.call}. It executes a single frame in the game. + def call + FelFlame::Stage.call + end + # :nocov: + end + + # Creates and manages Entities. Allows accessing Entities using their {FelFlame::Entities#id ID}. Entities are just collections of Components. class Entities; end # Creates component managers and allows accessing them them under the {FelFlame::Components} namespace as Constants # - # To see how component managers are used please look at the {FelFlame::Helper::ComponentManagerTemplate} documentation. - # - # TODO: Improve Component overview + # To see how component managers are used please look at the {FelFlame::ComponentManager} documentation. class Components; end - # Creates an manages Systems. + # Creates an manages Systems. Systems are the logic of the game and do not contain any data within them. # - # TODO: Improve System overview + # TODO: Improve Systems overview class Systems; end + + # Creates and manages Scenes. Scenes are collections of Systems, and execute all the Systems when called upon. + # + # TODO: Improve Scenes overview + class Scenes; end + + # Stores Scenes which you want to execute on each frame. When called upon will execute all Systems in the Scenes in the Stage and will execute them according to their priority order. + class Stage; end end # An alias for {FelFlame} @@ -36,7 +51,7 @@ FF::Cmp = FelFlame::Components FF::Sys = FelFlame::Systems # An alias for {FelFlame::Scenes} -#FF::Sce = FelFlame::Scenes -# +FF::Sce = FelFlame::Scenes + # An alias for {FelFlame::Stage} -#FF::Stg = FelFlame::Stage +FF::Stg = FelFlame::Stage diff --git a/scene_manager.rb b/scene_manager.rb index 31be12e..f18a39f 100644 --- a/scene_manager.rb +++ b/scene_manager.rb @@ -1,4 +1,54 @@ class FelFlame - class Scene + class Scenes + # The Constant name assigned to this Scene + attr_reader :const_name + + attr_writer :systems + + # Create a new Scene using the name given + # @param name [String] String format must follow requirements of a constant + def initialize(name) + FelFlame::Scenes.const_set(name, self) + @const_name = name + end + + # The list of Systems this Scene contains + # @return [Array<System>] + def systems + @systems ||= [] + end + + # Execute all systems in this Scene, in the order of their priority + # @return [Boolean] +true+ + def call + systems.each(&:call) + true + end + + # Adds any number of Systems to this Scene + # @return [Boolean] +true+ + def add(*systems_to_add) + self.systems |= systems_to_add + systems.sort_by!(&:priority) + FelFlame::Stage.update_systems_list if FelFlame::Stage.scenes.include? self + true + end + + # Removes any number of SystemS from this Scene + # @return [Boolean] +true+ + def remove(*systems_to_remove) + self.systems -= systems_to_remove + systems.sort_by!(&:priority) + FelFlame::Stage.update_systems_list if FelFlame::Stage.scenes.include? self + true + end + + # Removes all Systems from this Scene + # @return [Boolean] +true+ + def clear + systems.clear + FelFlame::Stage.update_systems_list if FelFlame::Stage.scenes.include? self + true + end end end diff --git a/stage_manager.rb b/stage_manager.rb index c5bd741..87ee955 100644 --- a/stage_manager.rb +++ b/stage_manager.rb @@ -1,4 +1,70 @@ class FelFlame class Stage + class <<self + # Allows clearing of scenes and systems. + # Used internally by FelFlame and shouldn't need to be ever used by developers + # @!visibility private + attr_writer :scenes, :systems + + # Add any number of Scenes to the Stage + # @return [Boolean] +true+ + def add(*scenes_to_add) + self.scenes |= scenes_to_add + scenes_to_add.each do |scene| + self.systems |= scene.systems + end + systems.sort_by!(&:priority) + true + end + + # Remove any number of Scenes from the Stage + # @return [Boolean] +true+ + def remove(*scenes_to_remove) + self.scenes -= scenes_to_remove + update_systems_list + true + end + + # Updates the list of systems from the Scenes added to the Stage and make sure they are ordered correctly + # This is used internally by FelFlame and shouldn't need to be ever used by developers + # @return [Boolean] +true+ + # @!visibility private + def update_systems_list + systems.clear + scenes.each do |scene| + self.systems |= scene.systems + end + systems.sort_by!(&:priority) + true + end + + # Clears all Scenes that were added to the Stage + # @return [Boolean] +true+ + def clear + systems.clear + scenes.clear + true + end + + # Executes one frame of the game. This executes all the Systems in the Scenes added to the Stage. Systems that exist in two or more different Scenes will still only get executed once. + # @return [Boolean] +true+ + def call + systems.each(&:call) + true + end + + # Contains all the Scenes added to the Stage + # @return [Array<Scene>] + def scenes + @scenes ||= [] + end + + # Stores systems in the order the stage manager needs to call them + # This method should generally only need to be used internally and not by a game developer + # @!visibility private + def systems + @systems ||= [] + end + end end end diff --git a/system_manager.rb b/system_manager.rb index f969ef2..cab2c4d 100644 --- a/system_manager.rb +++ b/system_manager.rb @@ -4,7 +4,7 @@ class FelFlame attr_accessor :priority # The Constant name assigned to this System - attr_accessor :const_name + attr_reader :const_name # Allows overwriting the storage of triggers, such as for clearing. # This method should generally only need to be used internally and @@ -12,6 +12,10 @@ class FelFlame # @!visibility private attr_writer :addition_triggers, :removal_triggers, :attr_triggers + def priority=(priority) + @priority = priority + FelFlame::Stage.systems.sort_by!(&:priority) + end # Stores references to components or their managers that trigger # this component when a component or component from that manager # is added to an entity. @@ -103,7 +107,7 @@ class FelFlame # FelFlame::Systems::ExampleSystem.clear_triggers :attr_triggers, :example_attr # @param trigger_types [:Symbols] One or more of the following trigger types: +:addition_triggers+, +:removal_triggers+, or +:attr_triggers+. If attr_triggers is used then you may pass attributes you wish to be cleared as symbols in this parameter as well # @param component_or_manager [Component or ComponentManager] The object to clear triggers from. Use Nil to clear triggers from all components associated with this system. - # @return [Boolean] true + # @return [Boolean] +true+ def clear_triggers(*trigger_types, component_or_manager: nil) trigger_types = [:addition_triggers, :removal_triggers, :attr_triggers] if trigger_types.empty? @@ -149,9 +153,6 @@ class FelFlame (trigger_types - [:addition_triggers, :removal_triggers, :attr_triggers]).each do |attr| next if component_or_manager.attr_triggers[attr].nil? component_or_manager.attr_triggers[attr].delete self - #self.attr_triggers[component_or_manager].each do |attr| - # component_or_manager.attr_triggers[attr].delete self - #end end self.attr_triggers[component_or_manager] -= trigger_types unless self.attr_triggers[component_or_manager].nil? end @@ -172,11 +173,12 @@ class FelFlame component_or_manager.send(trigger_type).delete self end end + true end # Add a component or component manager so that it triggers this system when the component or a component from the component manager is added to an entity # @param component_or_manager [Component or ComponentManager] The component or component manager to trigger this system when added - # @return [Boolean] true + # @return [Boolean] +true+ def trigger_when_added(component_or_manager) self.addition_triggers |= [component_or_manager] component_or_manager.addition_triggers |= [self] @@ -185,7 +187,7 @@ class FelFlame # Add a component or component manager so that it triggers this system when the component or a component from the component manager is removed from an entity # @param component_or_manager [Component or ComponentManager] The component or component manager to trigger this system when removed - # @return [Boolean] true + # @return [Boolean] +true+ def trigger_when_removed(component_or_manager) self.removal_triggers |= [component_or_manager] component_or_manager.removal_triggers |= [self] @@ -193,6 +195,7 @@ class FelFlame end # Add a component or component manager so that it triggers this system when a component's attribute is changed. + # @return [Boolean] +true+ def trigger_when_is_changed(component_or_manager, attr) if component_or_manager.attr_triggers[attr].nil? component_or_manager.attr_triggers[attr] = [self] @@ -204,6 +207,7 @@ class FelFlame else self.attr_triggers[component_or_manager] |= [attr] end + true end end end |
