diff options
Diffstat (limited to 'doc/FelFlame')
| -rw-r--r-- | doc/FelFlame/Components.html | 378 | ||||
| -rw-r--r-- | doc/FelFlame/Entities.html | 1128 | ||||
| -rw-r--r-- | doc/FelFlame/Helper.html | 142 | ||||
| -rw-r--r-- | doc/FelFlame/Helper/BaseComponent.html | 867 | ||||
| -rw-r--r-- | doc/FelFlame/Helper/ComponentManager.html | 878 | ||||
| -rw-r--r-- | doc/FelFlame/Helper/ComponentManagerTemplate.html | 1027 | ||||
| -rw-r--r-- | doc/FelFlame/Systems.html | 134 |
7 files changed, 0 insertions, 4554 deletions
diff --git a/doc/FelFlame/Components.html b/doc/FelFlame/Components.html deleted file mode 100644 index 084ef72..0000000 --- a/doc/FelFlame/Components.html +++ /dev/null @@ -1,378 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> -<meta name="viewport" content="width=device-width, initial-scale=1.0"> -<title> - Class: FelFlame::Components - - — 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::Components"; - 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">Components</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::Components - - - -</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::Components</li> - - </ul> - <a href="#" class="inheritanceTree">show all</a> - - </dd> - </dl> - - - - - <dl> - <dt>Extended by:</dt> - <dd>Enumerable</dd> - </dl> - - - - - - - - - <dl> - <dt>Defined in:</dt> - <dd>felflame.rb<span class="defines">,<br /> - component_manager.rb</span> -</dd> - </dl> - -</div> - -<h2>Overview</h2><div class="docstring"> - <div class="discussion"> - -<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 <span class='object_link'><a href="Helper/ComponentManagerTemplate.html" title="FelFlame::Helper::ComponentManagerTemplate (class)">Helper::ComponentManagerTemplate</a></span> documentation.</p> - -<p>TODO: Improve Component overview</p> - - - </div> -</div> -<div class="tags"> - - -</div> - - - - - - - - <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="#each-class_method" title="each (class method)">.<strong>each</strong>(&block) ⇒ Enumerator </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Iterate over all existing component managers.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#new-class_method" title="new (class method)">.<strong>new</strong>(component_name, *attrs, **attrs_with_defaults) ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Creates a new component manager.</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="each-class_method"> - - .<strong>each</strong>(&block) ⇒ <tt>Enumerator</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Iterate over all existing component managers. You also call other enumerable methods instead of each, such as `each_with_index` or `select`</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"> - - -32 -33 -34</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 32</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> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - <div class="method_details "> - <h3 class="signature " id="new-class_method"> - - .<strong>new</strong>(component_name, *attrs, **attrs_with_defaults) ⇒ <tt>Object</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Creates a new component manager.</p> - - - </div> -</div> -<div class="tags"> - <p class="tag_title">Parameters:</p> -<ul class="param"> - - <li> - - <span class='name'>component_name</span> - - - <span class='type'>(<tt>String</tt>)</span> - - - - — - <div class='inline'> -<p>Name of your new component manager. Must be stylized in the format of constants in Ruby</p> -</div> - - </li> - - <li> - - <span class='name'>attrs</span> - - - <span class='type'>(<tt>:Symbols</tt>)</span> - - - - — - <div class='inline'> -<p>New components made with this manager will include these symbols as accessors, the values of these accessors will default to nil</p> -</div> - - </li> - - <li> - - <span class='name'>attrs_with_defaults</span> - - - <span class='type'>(<tt>Keywords</tt>)</span> - - - - — - <div class='inline'> -<p>New components made with this manager will include these keywords as accessors, their defaults set to the values given to the keywords</p> -</div> - - </li> - -</ul> - - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 15</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_component_name'>component_name</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_attrs'>attrs</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_attrs_with_defaults'>attrs_with_defaults</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="Helper.html" title="FelFlame::Helper (class)">Helper</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Helper/ComponentManagerTemplate.html" title="FelFlame::Helper::ComponentManagerTemplate (class)">ComponentManagerTemplate</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='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='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'>:initialize</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='kw'>end</span> - <span class='kw'>end</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - </div> - -</div> - - <div id="footer"> - Generated on Thu Jun 10 12:03:05 2021 by - <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.9.26 (ruby-2.7.2). -</div> - - </div> - </body> -</html>
\ No newline at end of file diff --git a/doc/FelFlame/Entities.html b/doc/FelFlame/Entities.html deleted file mode 100644 index 8f91e9e..0000000 --- a/doc/FelFlame/Entities.html +++ /dev/null @@ -1,1128 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> -<meta name="viewport" content="width=device-width, initial-scale=1.0"> -<title> - Class: FelFlame::Entities - - — 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::Entities"; - 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 (E)</a> » - <span class='title'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span> - » - <span class="title">Entities</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::Entities - - - -</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::Entities</li> - - </ul> - <a href="#" class="inheritanceTree">show all</a> - - </dd> - </dl> - - - - - <dl> - <dt>Extended by:</dt> - <dd>Enumerable</dd> - </dl> - - - - - - - - - <dl> - <dt>Defined in:</dt> - <dd>felflame.rb<span class="defines">,<br /> - entity_manager.rb</span> -</dd> - </dl> - -</div> - -<h2>Overview</h2><div class="docstring"> - <div class="discussion"> - -<p>Creates and manages Entities. Allows accessing Entities using their <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">ID</a></span></p> - -<p>TODO: Improve Entity 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="#id-instance_method" title="#id (instance method)">#<strong>id</strong> ⇒ Integer </a> - - - - </span> - - - - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Holds the unique ID of this entity.</p> -</div></span> - -</li> - - - </ul> - - - - - - <h2> - Class Method Summary - <small><a href="#" class="summary_toggle">collapse</a></small> - </h2> - - <ul class="summary"> - - <li class="public "> - <span class="summary_signature"> - - <a href="#[]-class_method" title="[] (class method)">.<strong>[]</strong>(entity_id) ⇒ Entity </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Gets an Entity from the given unique ID.</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 entities.</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>(component) ⇒ Boolean </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Returns true when added, or false if it already belongs to the Entity Add a component to the Entity.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#components-instance_method" title="#components (instance method)">#<strong>components</strong> ⇒ Hash </a> - - - - </span> - - - - - - - - - - <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 IDs of components attached to this entity.</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 Entity from the list and purges all references to this Entity from other Components, as well as its <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">ID</a></span> and data.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(*components) ⇒ Entities </a> - - - - </span> - - - <span class="note title constructor">constructor</span> - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Creating a new component.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#remove-instance_method" title="#remove (instance method)">#<strong>remove</strong>(component) ⇒ Boolean </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Remove a component from the Entity.</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::Entities#id (method)">ID reader</a></span>.</p> -</div></span> - -</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> - - - - <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>(*components) ⇒ <tt><span class='object_link'><a href="" title="FelFlame::Entities (class)">Entities</a></span></tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Creating a new component</p> - - - </div> -</div> -<div class="tags"> - <p class="tag_title">Parameters:</p> -<ul class="param"> - - <li> - - <span class='name'>components</span> - - - <span class='type'>(<tt>Component</tt>)</span> - - - - — - <div class='inline'> -<p>Can be any number of components, identical duplicated will be automatically purged however different components from the same component manager are allowed.</p> -</div> - - </li> - -</ul> - - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 9</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_components'>components</span><span class='rparen'>)</span> - <span class='comment'># Assign new unique ID -</span> <span class='id identifier rubyid_new_id'>new_id</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_find_index'>find_index</span> <span class='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='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='id identifier rubyid_new_id'>new_id</span> - - <span class='comment'># Add each component -</span> <span class='id identifier rubyid_components'>components</span><span class='period'>.</span><span class='id identifier rubyid_uniq'>uniq</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span> - <span class='id identifier rubyid_add'>add</span> <span class='id identifier rubyid_component'>component</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'>self</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - -</div> - - <div id="instance_attr_details" class="attr_details"> - <h2>Instance Attribute Details</h2> - - - <span id="id=-instance_method"></span> - <div class="method_details first"> - <h3 class="signature first" id="id-instance_method"> - - #<strong>id</strong> ⇒ <tt>Integer</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Holds the unique ID of this entity</p> - - - </div> -</div> -<div class="tags"> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>Integer</tt>)</span> - - - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -5 -6 -7</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 5</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_id'>id</span> - <span class='ivar'>@id</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - </div> - - - <div id="class_method_details" class="method_details_list"> - <h2>Class Method Details</h2> - - - <div class="method_details first"> - <h3 class="signature first" id="[]-class_method"> - - .<strong>[]</strong>(entity_id) ⇒ <tt>Entity</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Gets an Entity from the given unique ID. Usage is simular to how an Array lookup works</p> - - - </div> -</div> -<div class="tags"> - <p class="tag_title">Parameters:</p> -<ul class="param"> - - <li> - - <span class='name'>entity_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>Entity</tt>)</span> - - - - — - <div class='inline'> -<p>returns the Entity that uses the given unique ID, nil if there is no Entity associated with the given ID</p> -</div> - - </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 'entity_manager.rb', line 97</span> - -<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span> - <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rbracket'>]</span> -<span class='kw'>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 entities. In general when using ECS the use of this method should never be neccassary unless you are doing something very wrong, however I will not stop you. You also call other enumerable methods instead of each, such as `each_with_index` or `select`</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"> - - -104 -105 -106</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 104</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_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="add-instance_method"> - - #<strong>add</strong>(component) ⇒ <tt>Boolean</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Returns true when added, or false if it already belongs to the Entity Add a component to the Entity</p> - - - </div> -</div> -<div class="tags"> - <p class="tag_title">Parameters:</p> -<ul class="param"> - - <li> - - <span class='name'>component</span> - - - <span class='type'>(<tt>Component</tt>)</span> - - - - — - <div class='inline'> -<p>A component created from any component manager</p> -</div> - - </li> - -</ul> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>Boolean</tt>)</span> - - - - — - <div class='inline'> -<p>true if component is added, false if it already is attached</p> -</div> - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 54</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_add'>add</span> <span class='id identifier rubyid_component'>component</span> - <span class='kw'>if</span> <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> - <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</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='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbracket'>]</span> - <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_linked_entities'>linked_entities</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_id'>id</span> - <span class='kw'>true</span> - <span class='kw'>elsif</span> <span class='op'>!</span><span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> - <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> - <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_linked_entities'>linked_entities</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_id'>id</span> - <span class='kw'>true</span> - <span class='kw'>else</span> - <span class='kw'>false</span> - <span class='kw'>end</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - <div class="method_details "> - <h3 class="signature " id="components-instance_method"> - - #<strong>components</strong> ⇒ <tt>Hash</tt> - - - - - -</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 IDs of components attached to this entity.</p> - - - </div> -</div> -<div class="tags"> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>Hash</tt>)</span> - - - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -24 -25 -26</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 24</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_components'>components</span> - <span class='ivar'>@components</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> -<span class='kw'>end</span></pre> - </td> - </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 Entity from the list and purges all references to this Entity from other Components, as well as its <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">ID</a></span> and data.</p> - - - </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>true.</p> -</div> - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 36</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span> - <span class='id identifier rubyid_components'>components</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component_manager'>component_manager</span><span class='comma'>,</span> <span class='id identifier rubyid_component_array'>component_array</span><span class='op'>|</span> - <span class='id identifier rubyid_component_array'>component_array</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component_id'>component_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='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span> - <span class='id identifier rubyid_component_manager'>component_manager</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'>FelFlame::</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> - <span class='rparen'>)</span><span class='lbracket'>[</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_linked_entities'>linked_entities</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span> - <span class='kw'>end</span> - <span class='kw'>end</span> - <span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Entities (class)">Entities</a></span></span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_id'>id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>nil</span> - <span class='ivar'>@id</span> <span class='op'>=</span> <span class='kw'>nil</span> - <span class='ivar'>@components</span> <span class='op'>=</span> <span class='kw'>nil</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>(component) ⇒ <tt>Boolean</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Remove a component from the Entity</p> - - - </div> -</div> -<div class="tags"> - <p class="tag_title">Parameters:</p> -<ul class="param"> - - <li> - - <span class='name'>component</span> - - - <span class='type'>(<tt>Component</tt>)</span> - - - - — - <div class='inline'> -<p>A component created from any component manager</p> -</div> - - </li> - -</ul> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>Boolean</tt>)</span> - - - - — - <div class='inline'> -<p>true if component is removed, false if it wasnt attached to component</p> -</div> - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -71 -72 -73 -74 -75 -76 -77 -78</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 71</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_remove'>remove</span> <span class='id identifier rubyid_component'>component</span> - <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> - <span class='kw'>if</span> <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_linked_entities'>linked_entities</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_id'>id</span> - <span class='kw'>true</span> - <span class='kw'>else</span> - <span class='kw'>false</span> - <span class='kw'>end</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - <div class="method_details "> - <h3 class="signature " id="to_i-instance_method"> - - #<strong>to_i</strong> ⇒ <tt>Integer</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>An alias for the <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">ID reader</a></span></p> - - - </div> -</div> -<div class="tags"> - -<p class="tag_title">Returns:</p> -<ul class="return"> - - <li> - - - <span class='type'>(<tt>Integer</tt>)</span> - - - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -30 -31 -32</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 30</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="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"> - - -83 -84</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'entity_manager.rb', line 83</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_to_json'>to_json</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - </div> - -</div> - - <div id="footer"> - Generated on Thu Jun 10 12:03:05 2021 by - <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.9.26 (ruby-2.7.2). -</div> - - </div> - </body> -</html>
\ No newline at end of file diff --git a/doc/FelFlame/Helper.html b/doc/FelFlame/Helper.html deleted file mode 100644 index e04079a..0000000 --- a/doc/FelFlame/Helper.html +++ /dev/null @@ -1,142 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> -<meta name="viewport" content="width=device-width, initial-scale=1.0"> -<title> - Class: FelFlame::Helper - - — 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::Helper"; - 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 (H)</a> » - <span class='title'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span> - » - <span class="title">Helper</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::Helper - - - -</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::Helper</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>Namespace for helper functions and inheritance classes</p> - - - </div> -</div> -<div class="tags"> - - -</div><h2>Defined Under Namespace</h2> -<p class="children"> - - - - - <strong class="classes">Classes:</strong> <span class='object_link'><a href="Helper/ComponentManagerTemplate.html" title="FelFlame::Helper::ComponentManagerTemplate (class)">ComponentManagerTemplate</a></span> - - -</p> - - - - - - - - - -</div> - - <div id="footer"> - Generated on Thu Jun 10 12:03:05 2021 by - <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.9.26 (ruby-2.7.2). -</div> - - </div> - </body> -</html>
\ No newline at end of file diff --git a/doc/FelFlame/Helper/BaseComponent.html b/doc/FelFlame/Helper/BaseComponent.html deleted file mode 100644 index de630b1..0000000 --- a/doc/FelFlame/Helper/BaseComponent.html +++ /dev/null @@ -1,867 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> -<meta name="viewport" content="width=device-width, initial-scale=1.0"> -<title> - Class: FelFlame::Helper::BaseComponent - - — 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::Helper::BaseComponent"; - 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 (B)</a> » - <span class='title'><span class='object_link'><a href="../../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span> » <span class='title'><span class='object_link'><a href="../Helper.html" title="FelFlame::Helper (class)">Helper</a></span></span> - » - <span class="title">BaseComponent</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::Helper::BaseComponent - - - -</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::Helper::BaseComponent</li> - - </ul> - <a href="#" class="inheritanceTree">show all</a> - - </dd> - </dl> - - - - - - - - - - - - <dl> - <dt>Defined in:</dt> - <dd>component_manager.rb</dd> - </dl> - -</div> - - - - - - <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2> - <ul class="summary"> - - <li class="public "> - <span class="summary_signature"> - - <a href="#id-instance_method" title="#id (instance method)">#<strong>id</strong> ⇒ Object </a> - - - - </span> - - - - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Returns the value of attribute id.</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>(val) ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'></div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#data-class_method" title="data (class method)">.<strong>data</strong> ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'></div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#each-class_method" title="each (class method)">.<strong>each</strong> ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'></div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#new-class_method" title="new (class method)">.<strong>new</strong>(**opts) ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'></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="#attrs-instance_method" title="#attrs (instance method)">#<strong>attrs</strong> ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>def initialize_attr(name, default = nil) #TODO: fill this out #TODO: This might be bad form, maybe exclude completly end.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong> ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Returns true.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#linked_entities-instance_method" title="#linked_entities (instance method)">#<strong>linked_entities</strong> ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'></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> ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'></div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#to_json-instance_method" title="#to_json (instance method)">#<strong>to_json</strong> ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>TODO: Needs to get id and stuff?.</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> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>returns hash of updated attributes.</p> -</div></span> - -</li> - - - </ul> - - - - <div id="instance_attr_details" class="attr_details"> - <h2>Instance Attribute Details</h2> - - - <span id="id=-instance_method"></span> - <div class="method_details first"> - <h3 class="signature first" id="id-instance_method"> - - #<strong>id</strong> ⇒ <tt>Object</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Returns the value of attribute id.</p> - - - </div> -</div> -<div class="tags"> - - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -34 -35 -36</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 34</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_id'>id</span> - <span class='ivar'>@id</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - </div> - - - <div id="class_method_details" class="method_details_list"> - <h2>Class Method Details</h2> - - - <div class="method_details first"> - <h3 class="signature first" id="[]-class_method"> - - .<strong>[]</strong>(val) ⇒ <tt>Object</tt> - - - - - -</h3><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -41 -42 -43</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 41</span> - -<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_val'>val</span><span class='rparen'>)</span> - <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_val'>val</span><span class='rbracket'>]</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - <div class="method_details "> - <h3 class="signature " id="data-class_method"> - - .<strong>data</strong> ⇒ <tt>Object</tt> - - - - - -</h3><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -37 -38 -39</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 37</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_data'>data</span> - <span class='ivar'>@data</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="each-class_method"> - - .<strong>each</strong> ⇒ <tt>Object</tt> - - - - - -</h3><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -62 -63 -64 -65 -66</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 62</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span> - <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span> - <span class='kw'>yield</span> <span class='id identifier rubyid_component'>component</span> - <span class='kw'>end</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - <div class="method_details "> - <h3 class="signature " id="new-class_method"> - - .<strong>new</strong>(**opts) ⇒ <tt>Object</tt> - - - - - -</h3><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 45</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_new'>new</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_new_component'>new_component</span> <span class='op'>=</span> <span class='kw'>super</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_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_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='id identifier rubyid_new_component'>new_component</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'># Fill params -</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_new_component'>new_component</span><span class='period'>.</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='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='id identifier rubyid_new_component'>new_component</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="attrs-instance_method"> - - #<strong>attrs</strong> ⇒ <tt>Object</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>def initialize_attr(name, default = nil)</p> - -<pre class="code ruby"><code class="ruby"><span class='comment'>#TODO: fill this out -</span><span class='comment'>#TODO: This might be bad form, maybe exclude completly -</span></code></pre> - -<p>end</p> - - - </div> -</div> -<div class="tags"> - - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -103 -104 -105 -106 -107</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 103</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_attrs'>attrs</span> <span class='comment'>#TODO: maybe optimize removing the @ symbol -</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='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - <div class="method_details "> - <h3 class="signature " id="delete-instance_method"> - - #<strong>delete</strong> ⇒ <tt>Object</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Returns true</p> - - - </div> -</div> -<div class="tags"> - - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 85</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span> - <span class='comment'>#TODO: Remove component -</span> <span class='id identifier rubyid_linked_entities'>linked_entities</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='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='ivar'>@linked_entities</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="linked_entities-instance_method"> - - #<strong>linked_entities</strong> ⇒ <tt>Object</tt> - - - - - -</h3><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -73 -74 -75</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 73</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_linked_entities'>linked_entities</span> - <span class='ivar'>@linked_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>Object</tt> - - - - - -</h3><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -69 -70 -71</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 69</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="to_json-instance_method"> - - #<strong>to_json</strong> ⇒ <tt>Object</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>TODO: Needs to get id and stuff?</p> - - - </div> -</div> -<div class="tags"> - - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -109 -110 -111</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 109</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_to_json'>to_json</span> <span class='comment'>#TODO: Needs to get id and stuff? -</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> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>returns hash of updated attributes</p> - - - </div> -</div> -<div class="tags"> - - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -78 -79 -80 -81 -82</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 78</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 Thu Jun 10 01:05:46 2021 by - <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.9.26 (ruby-2.7.2). -</div> - - </div> - </body> -</html>
\ No newline at end of file diff --git a/doc/FelFlame/Helper/ComponentManager.html b/doc/FelFlame/Helper/ComponentManager.html deleted file mode 100644 index a903181..0000000 --- a/doc/FelFlame/Helper/ComponentManager.html +++ /dev/null @@ -1,878 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> -<meta name="viewport" content="width=device-width, initial-scale=1.0"> -<title> - Class: FelFlame::Helper::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::Helper::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'><span class='object_link'><a href="../Helper.html" title="FelFlame::Helper (class)">Helper</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::Helper::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::Helper::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, or by using the <span class='object_link'><a href="#attrs-instance_method" title="FelFlame::Helper::ComponentManager#attrs (method)">#attrs</a></span> and <span class='object_link'><a href="#update_attrs-instance_method" title="FelFlame::Helper::ComponentManager#update_attrs (method)">#update_attrs</a></span> methods instead.</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="#id-instance_method" title="#id (instance method)">#<strong>id</strong> ⇒ Object </a> - - - - </span> - - - - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Returns the value of attribute id.</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>(val) ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'></div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#data-class_method" title="data (class method)">.<strong>data</strong> ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'></div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#each-class_method" title="each (class method)">.<strong>each</strong> ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'></div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#new-class_method" title="new (class method)">.<strong>new</strong>(**attrs) ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'></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="#attrs-instance_method" title="#attrs (instance method)">#<strong>attrs</strong> ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>def initialize_attr(name, default = nil) #TODO: fill this out #TODO: This might be bad form, maybe exclude completly end.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong> ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Returns true.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#linked_entities-instance_method" title="#linked_entities (instance method)">#<strong>linked_entities</strong> ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'></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> ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'></div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#to_json-instance_method" title="#to_json (instance method)">#<strong>to_json</strong> ⇒ Object </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>TODO: Needs to get id and stuff?.</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> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>returns hash of updated attributes.</p> -</div></span> - -</li> - - - </ul> - - - - <div id="instance_attr_details" class="attr_details"> - <h2>Instance Attribute Details</h2> - - - <span id="id=-instance_method"></span> - <div class="method_details first"> - <h3 class="signature first" id="id-instance_method"> - - #<strong>id</strong> ⇒ <tt>Object</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Returns the value of attribute id.</p> - - - </div> -</div> -<div class="tags"> - - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -45 -46 -47</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 45</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_id'>id</span> - <span class='ivar'>@id</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - </div> - - - <div id="class_method_details" class="method_details_list"> - <h2>Class Method Details</h2> - - - <div class="method_details first"> - <h3 class="signature first" id="[]-class_method"> - - .<strong>[]</strong>(val) ⇒ <tt>Object</tt> - - - - - -</h3><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -52 -53 -54</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 52</span> - -<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_val'>val</span><span class='rparen'>)</span> - <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_val'>val</span><span class='rbracket'>]</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - <div class="method_details "> - <h3 class="signature " id="data-class_method"> - - .<strong>data</strong> ⇒ <tt>Object</tt> - - - - - -</h3><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -48 -49 -50</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 48</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_data'>data</span> - <span class='ivar'>@data</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="each-class_method"> - - .<strong>each</strong> ⇒ <tt>Object</tt> - - - - - -</h3><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -73 -74 -75 -76 -77</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 73</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span> - <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span> - <span class='kw'>yield</span> <span class='id identifier rubyid_component'>component</span> - <span class='kw'>end</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - <div class="method_details "> - <h3 class="signature " id="new-class_method"> - - .<strong>new</strong>(**attrs) ⇒ <tt>Object</tt> - - - - - -</h3><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 56</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span> - <span class='id identifier rubyid_new_component'>new_component</span> <span class='op'>=</span> <span class='kw'>super</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_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_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='id identifier rubyid_new_component'>new_component</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'># 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_new_component'>new_component</span><span class='period'>.</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='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='id identifier rubyid_new_component'>new_component</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="attrs-instance_method"> - - #<strong>attrs</strong> ⇒ <tt>Object</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>def initialize_attr(name, default = nil)</p> - -<pre class="code ruby"><code class="ruby"><span class='comment'>#TODO: fill this out -</span><span class='comment'>#TODO: This might be bad form, maybe exclude completly -</span></code></pre> - -<p>end</p> - - - </div> -</div> -<div class="tags"> - - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -114 -115 -116 -117 -118</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 114</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_attrs'>attrs</span> <span class='comment'>#TODO: maybe optimize removing the @ symbol -</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='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - <div class="method_details "> - <h3 class="signature " id="delete-instance_method"> - - #<strong>delete</strong> ⇒ <tt>Object</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Returns true</p> - - - </div> -</div> -<div class="tags"> - - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 96</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span> - <span class='comment'>#TODO: Remove component -</span> <span class='id identifier rubyid_linked_entities'>linked_entities</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='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='ivar'>@linked_entities</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="linked_entities-instance_method"> - - #<strong>linked_entities</strong> ⇒ <tt>Object</tt> - - - - - -</h3><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -84 -85 -86</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 84</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_linked_entities'>linked_entities</span> - <span class='ivar'>@linked_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>Object</tt> - - - - - -</h3><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -80 -81 -82</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 80</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="to_json-instance_method"> - - #<strong>to_json</strong> ⇒ <tt>Object</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>TODO: Needs to get id and stuff?</p> - - - </div> -</div> -<div class="tags"> - - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -120 -121 -122</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 120</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_to_json'>to_json</span> <span class='comment'>#TODO: Needs to get id and stuff? -</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> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>returns hash of updated attributes</p> - - - </div> -</div> -<div class="tags"> - - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -89 -90 -91 -92 -93</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_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 Thu Jun 10 02:53:45 2021 by - <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.9.26 (ruby-2.7.2). -</div> - - </div> - </body> -</html>
\ No newline at end of file diff --git a/doc/FelFlame/Helper/ComponentManagerTemplate.html b/doc/FelFlame/Helper/ComponentManagerTemplate.html deleted file mode 100644 index 97d8af7..0000000 --- a/doc/FelFlame/Helper/ComponentManagerTemplate.html +++ /dev/null @@ -1,1027 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> -<meta name="viewport" content="width=device-width, initial-scale=1.0"> -<title> - Class: FelFlame::Helper::ComponentManagerTemplate - - — 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::Helper::ComponentManagerTemplate"; - 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'><span class='object_link'><a href="../Helper.html" title="FelFlame::Helper (class)">Helper</a></span></span> - » - <span class="title">ComponentManagerTemplate</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::Helper::ComponentManagerTemplate - - - -</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::Helper::ComponentManagerTemplate</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 `@component.var = 5`), or by using the <span class='object_link'><a href="#attrs-instance_method" title="FelFlame::Helper::ComponentManagerTemplate#attrs (method)">#attrs</a></span> and <span class='object_link'><a href="#update_attrs-instance_method" title="FelFlame::Helper::ComponentManagerTemplate#update_attrs (method)">#update_attrs</a></span> methods instead.</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="#id-instance_method" title="#id (instance method)">#<strong>id</strong> ⇒ Object </a> - - - - </span> - - - - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Holds the <span class='object_link'><a href="#id-instance_method" title="FelFlame::Helper::ComponentManagerTemplate#id (method)">unique ID</a></span> of a component.</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::Helper::ComponentManagerTemplate#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> ⇒ Enumerator </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Iterates over all components within the component manager.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#new-class_method" title="new (class method)">.<strong>new</strong>(**attrs) ⇒ Object </a> - - - - </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> - - - </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="#attrs-instance_method" title="#attrs (instance method)">#<strong>attrs</strong> ⇒ Hash </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Returns 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::Helper::ComponentManagerTemplate#id (method)">ID</a></span> and data.</p> -</div></span> - -</li> - - - <li class="public "> - <span class="summary_signature"> - - <a href="#linked_entities-instance_method" title="#linked_entities (instance method)">#<strong>linked_entities</strong> ⇒ Array </a> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>A list of components that are linked to the component.</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 ID reader.</p> -</div></span> - -</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 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> - - - - </span> - - - - - - - - - - <span class="summary_desc"><div class='inline'> -<p>Update attribute values using a hash or keywords.</p> -</div></span> - -</li> - - - </ul> - - - - <div id="instance_attr_details" class="attr_details"> - <h2>Instance Attribute Details</h2> - - - <span id="id=-instance_method"></span> - <div class="method_details first"> - <h3 class="signature first" id="id-instance_method"> - - #<strong>id</strong> ⇒ <tt>Object</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Holds the <span class='object_link'><a href="#id-instance_method" title="FelFlame::Helper::ComponentManagerTemplate#id (method)">unique ID</a></span> of a component. The <span class='object_link'><a href="#id-instance_method" title="FelFlame::Helper::ComponentManagerTemplate#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"> - - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -43 -44 -45</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 43</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_id'>id</span> - <span class='ivar'>@id</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - </div> - - - <div id="class_method_details" class="method_details_list"> - <h2>Class Method Details</h2> - - - <div class="method_details first"> - <h3 class="signature first" id="[]-class_method"> - - .<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::Helper::ComponentManagerTemplate#id (method)">unique ID</a></span>. Usage is simular to how an Array lookup works.</p> - - - </div> -</div> -<div class="tags"> - <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::Helper::ComponentManagerTemplate#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::Helper::ComponentManagerTemplate#id (method)">ID</a></span></p> -</div> - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -55 -56 -57</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 55</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> ⇒ <tt>Enumerator</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>Iterates over all components within the component manager</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"> - - -79 -80 -81 -82 -83</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 79</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span> - <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span> - <span class='kw'>yield</span> <span class='id identifier rubyid_component'>component</span> - <span class='kw'>end</span> -<span class='kw'>end</span></pre> - </td> - </tr> -</table> -</div> - - <div class="method_details "> - <h3 class="signature " id="new-class_method"> - - .<strong>new</strong>(**attrs) ⇒ <tt>Object</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"> - - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 60</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span> - <span class='id identifier rubyid_new_component'>new_component</span> <span class='op'>=</span> <span class='kw'>super</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_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_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='id identifier rubyid_new_component'>new_component</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'># 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_new_component'>new_component</span><span class='period'>.</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='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='id identifier rubyid_new_component'>new_component</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="attrs-instance_method"> - - #<strong>attrs</strong> ⇒ <tt>Hash</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</tt>)</span> - - - - — - <div class='inline'> -<p>Returns 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"> - - -121 -122 -123 -124 -125</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 121</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_attrs'>attrs</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='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::Helper::ComponentManagerTemplate#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>true.</p> -</div> - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 108</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span> - <span class='id identifier rubyid_linked_entities'>linked_entities</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='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='ivar'>@linked_entities</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="linked_entities-instance_method"> - - #<strong>linked_entities</strong> ⇒ <tt>Array</tt> - - - - - -</h3><div class="docstring"> - <div class="discussion"> - -<p>A list of components 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</tt>)</span> - - - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -94 -95 -96</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 94</span> - -<span class='kw'>def</span> <span class='id identifier rubyid_linked_entities'>linked_entities</span> - <span class='ivar'>@linked_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 ID reader</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"> - - -88 -89 -90</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 88</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="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"> - - -130 -131 -132</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 130</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> - - - - - -</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'></span> - - - - - <div class='inline'> -<p>Hash of updated attributes</p> -</div> - - </li> - -</ul> - -</div><table class="source_code"> - <tr> - <td> - <pre class="lines"> - - -100 -101 -102 -103 -104</pre> - </td> - <td> - <pre class="code"><span class="info file"># File 'component_manager.rb', line 100</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 Thu Jun 10 12:03:05 2021 by - <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.9.26 (ruby-2.7.2). -</div> - - </div> - </body> -</html>
\ No newline at end of file diff --git a/doc/FelFlame/Systems.html b/doc/FelFlame/Systems.html deleted file mode 100644 index c35e80e..0000000 --- a/doc/FelFlame/Systems.html +++ /dev/null @@ -1,134 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> -<meta name="viewport" content="width=device-width, initial-scale=1.0"> -<title> - Class: FelFlame::Systems - - — 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::Systems"; - 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">Systems</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::Systems - - - -</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::Systems</li> - - </ul> - <a href="#" class="inheritanceTree">show all</a> - - </dd> - </dl> - - - - - - - - - - - - <dl> - <dt>Defined in:</dt> - <dd>felflame.rb</dd> - </dl> - -</div> - -<h2>Overview</h2><div class="docstring"> - <div class="discussion"> - -<p>Creates an manages Systems.</p> - -<p>TODO: Improve System overview</p> - - - </div> -</div> -<div class="tags"> - - -</div> - - - - - - - - -</div> - - <div id="footer"> - Generated on Thu Jun 10 12:03:05 2021 by - <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.9.26 (ruby-2.7.2). -</div> - - </div> - </body> -</html>
\ No newline at end of file |
