felflame 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/.byebug_history +20 -0
  3. data/.gitignore +17 -0
  4. data/.inch.yml +11 -0
  5. data/.rspec +1 -0
  6. data/.rubocop.yml +13 -0
  7. data/.yardopts +13 -0
  8. data/CHANGELOG.md +5 -0
  9. data/Gemfile +11 -0
  10. data/Gemfile.lock +87 -0
  11. data/LICENSE +21 -0
  12. data/LICENSE.txt +21 -0
  13. data/README.mdown +410 -0
  14. data/Rakefile +45 -0
  15. data/bin/console +15 -0
  16. data/bin/setup +8 -0
  17. data/codeclimate/export-coverage.rb +16 -0
  18. data/deprecated/components/00_renderable.rb +19 -0
  19. data/deprecated/components/01_sprite.rb +57 -0
  20. data/deprecated/components/02_label.rb +32 -0
  21. data/deprecated/components/03_player_control.rb +26 -0
  22. data/deprecated/components/04_map.rb +21 -0
  23. data/deprecated/components/05_interactable.rb +16 -0
  24. data/deprecated/components/06_collidable.rb +22 -0
  25. data/deprecated/components/07_battle.rb +4 -0
  26. data/deprecated/components/07_indoor.rb +4 -0
  27. data/deprecated/components/07_overworld.rb +16 -0
  28. data/deprecated/components/debug_singleton.rb +13 -0
  29. data/deprecated/helpers/00_tileset.rb +56 -0
  30. data/deprecated/helpers/01_component.rb +74 -0
  31. data/deprecated/systems/00_update_levels.rb +34 -0
  32. data/deprecated/systems/10_player.rb +41 -0
  33. data/deprecated/systems/99_render.rb +37 -0
  34. data/docs/CNAME +1 -0
  35. data/docs/FelFlame.html +317 -0
  36. data/docs/FelFlame/ComponentManager.html +1627 -0
  37. data/docs/FelFlame/Components.html +423 -0
  38. data/docs/FelFlame/Entities.html +1054 -0
  39. data/docs/FelFlame/Helper.html +142 -0
  40. data/docs/FelFlame/Helper/ComponentManager.html +1627 -0
  41. data/docs/FelFlame/Scenes.html +761 -0
  42. data/docs/FelFlame/Stage.html +598 -0
  43. data/docs/FelFlame/Systems.html +1541 -0
  44. data/docs/_index.html +173 -0
  45. data/docs/class_list.html +51 -0
  46. data/docs/css/common.css +1 -0
  47. data/docs/css/full_list.css +58 -0
  48. data/docs/css/style.css +497 -0
  49. data/docs/file.README.html +498 -0
  50. data/docs/file_list.html +56 -0
  51. data/docs/frames.html +17 -0
  52. data/docs/index.html +498 -0
  53. data/docs/js/app.js +314 -0
  54. data/docs/js/full_list.js +216 -0
  55. data/docs/js/jquery.js +4 -0
  56. data/docs/method_list.html +475 -0
  57. data/docs/top-level-namespace.html +137 -0
  58. data/felflame.gemspec +45 -0
  59. data/lib/felflame.rb +59 -0
  60. data/lib/felflame/component_manager.rb +245 -0
  61. data/lib/felflame/entity_manager.rb +135 -0
  62. data/lib/felflame/scene_manager.rb +58 -0
  63. data/lib/felflame/stage_manager.rb +70 -0
  64. data/lib/felflame/system_manager.rb +213 -0
  65. data/lib/felflame/version.rb +5 -0
  66. data/logos/felflame-logo-text.png +0 -0
  67. data/logos/felflame-logo-text.svg +172 -0
  68. data/logos/felflame-logo.png +0 -0
  69. data/logos/felflame-logo.svg +97 -0
  70. metadata +239 -0
@@ -0,0 +1,423 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: FelFlame::Components
8
+
9
+ &mdash; Documentation by YARD 0.9.26
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "FelFlame::Components";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (C)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span>
41
+ &raquo;
42
+ <span class="title">Components</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: FelFlame::Components
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">FelFlame::Components</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+ <dl>
89
+ <dt>Extended by:</dt>
90
+ <dd>Enumerable</dd>
91
+ </dl>
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <dl>
101
+ <dt>Defined in:</dt>
102
+ <dd>felflame.rb<span class="defines">,<br />
103
+ component_manager.rb</span>
104
+ </dd>
105
+ </dl>
106
+
107
+ </div>
108
+
109
+ <h2>Overview</h2><div class="docstring">
110
+ <div class="discussion">
111
+
112
+ <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>
113
+
114
+ <p>To see how component managers are used please look at the <span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span> documentation.</p>
115
+
116
+
117
+ </div>
118
+ </div>
119
+ <div class="tags">
120
+
121
+
122
+ </div>
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+ <h2>
131
+ Class Method Summary
132
+ <small><a href="#" class="summary_toggle">collapse</a></small>
133
+ </h2>
134
+
135
+ <ul class="summary">
136
+
137
+ <li class="public ">
138
+ <span class="summary_signature">
139
+
140
+ <a href="#each-class_method" title="each (class method)">.<strong>each</strong>(&amp;block) &#x21d2; Enumerator </a>
141
+
142
+
143
+
144
+ </span>
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+ <span class="summary_desc"><div class='inline'>
155
+ <p>Iterate over all existing component managers.</p>
156
+ </div></span>
157
+
158
+ </li>
159
+
160
+
161
+ <li class="public ">
162
+ <span class="summary_signature">
163
+
164
+ <a href="#new-class_method" title="new (class method)">.<strong>new</strong>(component_name, *attrs, **attrs_with_defaults) &#x21d2; ComponentManager </a>
165
+
166
+
167
+
168
+ </span>
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+ <span class="summary_desc"><div class='inline'>
179
+ <p>Creates a new <span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">component manager</a></span>.</p>
180
+ </div></span>
181
+
182
+ </li>
183
+
184
+
185
+ </ul>
186
+
187
+
188
+
189
+
190
+
191
+ <div id="class_method_details" class="method_details_list">
192
+ <h2>Class Method Details</h2>
193
+
194
+
195
+ <div class="method_details first">
196
+ <h3 class="signature first" id="each-class_method">
197
+
198
+ .<strong>each</strong>(&amp;block) &#x21d2; <tt>Enumerator</tt>
199
+
200
+
201
+
202
+
203
+
204
+ </h3><div class="docstring">
205
+ <div class="discussion">
206
+
207
+ <p>Iterate over all existing component managers. You also call other enumerable methods instead of each, such as <code>each_with_index</code> or <code>select</code></p>
208
+
209
+
210
+ </div>
211
+ </div>
212
+ <div class="tags">
213
+
214
+ <p class="tag_title">Returns:</p>
215
+ <ul class="return">
216
+
217
+ <li>
218
+
219
+
220
+ <span class='type'>(<tt>Enumerator</tt>)</span>
221
+
222
+
223
+
224
+ </li>
225
+
226
+ </ul>
227
+
228
+ </div><table class="source_code">
229
+ <tr>
230
+ <td>
231
+ <pre class="lines">
232
+
233
+
234
+ 47
235
+ 48
236
+ 49</pre>
237
+ </td>
238
+ <td>
239
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 47</span>
240
+
241
+ <span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
242
+ <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'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
243
+ <span class='kw'>end</span></pre>
244
+ </td>
245
+ </tr>
246
+ </table>
247
+ </div>
248
+
249
+ <div class="method_details ">
250
+ <h3 class="signature " id="new-class_method">
251
+
252
+ .<strong>new</strong>(component_name, *attrs, **attrs_with_defaults) &#x21d2; <tt><span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span></tt>
253
+
254
+
255
+
256
+
257
+
258
+ </h3><div class="docstring">
259
+ <div class="discussion">
260
+
261
+ <p>Creates a new <span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">component manager</a></span>.</p>
262
+
263
+
264
+ </div>
265
+ </div>
266
+ <div class="tags">
267
+
268
+ <div class="examples">
269
+ <p class="tag_title">Examples:</p>
270
+
271
+
272
+ <pre class="example code"><code><span class='comment'># Here color is set to default to red
273
+ </span><span class='comment'># while max and current are nil until set.
274
+ </span><span class='comment'># When you make a new component using this component manager
275
+ </span><span class='comment'># these are the values and accessors it will have.
276
+ </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'>Component</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Health</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='symbol'>:max</span><span class='comma'>,</span> <span class='symbol'>:current</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>red</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span></code></pre>
277
+
278
+ </div>
279
+ <p class="tag_title">Parameters:</p>
280
+ <ul class="param">
281
+
282
+ <li>
283
+
284
+ <span class='name'>component_name</span>
285
+
286
+
287
+ <span class='type'>(<tt>String</tt>)</span>
288
+
289
+
290
+
291
+ &mdash;
292
+ <div class='inline'>
293
+ <p>Name of your new component manager. Must be stylized in the format of constants in Ruby</p>
294
+ </div>
295
+
296
+ </li>
297
+
298
+ <li>
299
+
300
+ <span class='name'>attrs</span>
301
+
302
+
303
+ <span class='type'>(<tt>:Symbols</tt>)</span>
304
+
305
+
306
+
307
+ &mdash;
308
+ <div class='inline'>
309
+ <p>New components made with this manager will include these symbols as accessors, the values of these accessors will default to nil</p>
310
+ </div>
311
+
312
+ </li>
313
+
314
+ <li>
315
+
316
+ <span class='name'>attrs_with_defaults</span>
317
+
318
+
319
+ <span class='type'>(<tt>Keyword: DefaultValue</tt>)</span>
320
+
321
+
322
+
323
+ &mdash;
324
+ <div class='inline'>
325
+ <p>New components made with this manager will include these keywords as accessors, their defaults set to the values given to the keywords</p>
326
+ </div>
327
+
328
+ </li>
329
+
330
+ </ul>
331
+
332
+ <p class="tag_title">Returns:</p>
333
+ <ul class="return">
334
+
335
+ <li>
336
+
337
+
338
+ <span class='type'>(<tt><span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span></tt>)</span>
339
+
340
+
341
+
342
+ </li>
343
+
344
+ </ul>
345
+
346
+ </div><table class="source_code">
347
+ <tr>
348
+ <td>
349
+ <pre class="lines">
350
+
351
+
352
+ 19
353
+ 20
354
+ 21
355
+ 22
356
+ 23
357
+ 24
358
+ 25
359
+ 26
360
+ 27
361
+ 28
362
+ 29
363
+ 30
364
+ 31
365
+ 32
366
+ 33
367
+ 34
368
+ 35
369
+ 36
370
+ 37
371
+ 38
372
+ 39
373
+ 40
374
+ 41
375
+ 42
376
+ 43</pre>
377
+ </td>
378
+ <td>
379
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 19</span>
380
+
381
+ <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>
382
+ <span class='kw'>if</span> <span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Components (class)">Components</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_defined?'>const_defined?</span><span class='lparen'>(</span><span class='id identifier rubyid_component_name'>component_name</span><span class='rparen'>)</span>
383
+ <span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='const'>NameError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Component Manager &#39;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_component_name'>component_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>&#39; is already defined</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
384
+ <span class='kw'>end</span>
385
+
386
+
387
+ <span class='id identifier rubyid_const_set'>const_set</span><span class='lparen'>(</span><span class='id identifier rubyid_component_name'>component_name</span><span class='comma'>,</span> <span class='const'>Class</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span></span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
388
+ <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>
389
+ <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>
390
+ <span class='kw'>end</span>
391
+ <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>
392
+ <span class='id identifier rubyid_attrs_with_defaults'>attrs_with_defaults</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid__default'>_default</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
393
+ <span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Components (class)">Components</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_name'>component_name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_attr_reader'>attr_reader</span> <span class='id identifier rubyid_attr'>attr</span>
394
+ <span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Components (class)">Components</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_name'>component_name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attr'>attr</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
395
+ <span class='id identifier rubyid_attr_changed_trigger_systems'>attr_changed_trigger_systems</span><span class='lparen'>(</span><span class='id identifier rubyid_attr'>attr</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_equal?'>equal?</span> <span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_attr'>attr</span><span class='rparen'>)</span>
396
+ <span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</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'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
397
+ <span class='kw'>end</span>
398
+ <span class='kw'>end</span>
399
+ <span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Components (class)">Components</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_name'>component_name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='symbol'>:set_defaults</span><span class='rparen'>)</span> <span class='kw'>do</span>
400
+ <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>
401
+ <span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</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'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_default'>default</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span><span class='rparen'>)</span>
402
+ <span class='kw'>end</span>
403
+ <span class='kw'>end</span>
404
+ <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>
405
+ <span class='kw'>end</span></pre>
406
+ </td>
407
+ </tr>
408
+ </table>
409
+ </div>
410
+
411
+ </div>
412
+
413
+ </div>
414
+
415
+ <div id="footer">
416
+ Generated on Fri Jul 9 01:56:54 2021 by
417
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
418
+ 0.9.26 (ruby-2.7.3).
419
+ </div>
420
+
421
+ </div>
422
+ </body>
423
+ </html>
@@ -0,0 +1,1054 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: FelFlame::Entities
8
+
9
+ &mdash; Documentation by YARD 0.9.26
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "FelFlame::Entities";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (E)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span>
41
+ &raquo;
42
+ <span class="title">Entities</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: FelFlame::Entities
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">FelFlame::Entities</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+ <dl>
89
+ <dt>Extended by:</dt>
90
+ <dd>Enumerable</dd>
91
+ </dl>
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <dl>
101
+ <dt>Defined in:</dt>
102
+ <dd>felflame.rb<span class="defines">,<br />
103
+ entity_manager.rb</span>
104
+ </dd>
105
+ </dl>
106
+
107
+ </div>
108
+
109
+ <h2>Overview</h2><div class="docstring">
110
+ <div class="discussion">
111
+
112
+ <p>Creates and manages Entities. Allows accessing Entities using their <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">ID</a></span>. Entities are just collections of Components.</p>
113
+
114
+
115
+ </div>
116
+ </div>
117
+ <div class="tags">
118
+
119
+
120
+ </div>
121
+
122
+
123
+
124
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
125
+ <ul class="summary">
126
+
127
+ <li class="public ">
128
+ <span class="summary_signature">
129
+
130
+ <a href="#id-instance_method" title="#id (instance method)">#<strong>id</strong> &#x21d2; Integer </a>
131
+
132
+
133
+
134
+ </span>
135
+
136
+
137
+
138
+
139
+ <span class="note title readonly">readonly</span>
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+ <span class="summary_desc"><div class='inline'>
150
+ <p>Holds the unique ID of this entity.</p>
151
+ </div></span>
152
+
153
+ </li>
154
+
155
+
156
+ </ul>
157
+
158
+
159
+
160
+
161
+
162
+ <h2>
163
+ Class Method Summary
164
+ <small><a href="#" class="summary_toggle">collapse</a></small>
165
+ </h2>
166
+
167
+ <ul class="summary">
168
+
169
+ <li class="public ">
170
+ <span class="summary_signature">
171
+
172
+ <a href="#[]-class_method" title="[] (class method)">.<strong>[]</strong>(entity_id) &#x21d2; Entity </a>
173
+
174
+
175
+
176
+ </span>
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+ <span class="summary_desc"><div class='inline'>
187
+ <p>Gets an Entity from the given <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">unique ID</a></span>.</p>
188
+ </div></span>
189
+
190
+ </li>
191
+
192
+
193
+ <li class="public ">
194
+ <span class="summary_signature">
195
+
196
+ <a href="#each-class_method" title="each (class method)">.<strong>each</strong>(&amp;block) &#x21d2; Enumerator </a>
197
+
198
+
199
+
200
+ </span>
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+ <span class="summary_desc"><div class='inline'>
211
+ <p>Iterates over all entities.</p>
212
+ </div></span>
213
+
214
+ </li>
215
+
216
+
217
+ </ul>
218
+
219
+ <h2>
220
+ Instance Method Summary
221
+ <small><a href="#" class="summary_toggle">collapse</a></small>
222
+ </h2>
223
+
224
+ <ul class="summary">
225
+
226
+ <li class="public ">
227
+ <span class="summary_signature">
228
+
229
+ <a href="#add-instance_method" title="#add (instance method)">#<strong>add</strong>(*components_to_add) &#x21d2; Boolean </a>
230
+
231
+
232
+
233
+ </span>
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+ <span class="summary_desc"><div class='inline'>
244
+ <p>Add any number components to the Entity.</p>
245
+ </div></span>
246
+
247
+ </li>
248
+
249
+
250
+ <li class="public ">
251
+ <span class="summary_signature">
252
+
253
+ <a href="#components-instance_method" title="#components (instance method)">#<strong>components</strong> &#x21d2; Hash&lt;Component_Manager, Array&lt;Integer&gt;&gt; </a>
254
+
255
+
256
+
257
+ </span>
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+ <span class="summary_desc"><div class='inline'>
268
+ <p>A hash that uses component manager constant names as keys, and where the values of those keys are arrays that contain the <span class='object_link'><a href="ComponentManager.html#id-instance_method" title="FelFlame::ComponentManager#id (method)">IDs</a></span> of the components attached to this entity.</p>
269
+ </div></span>
270
+
271
+ </li>
272
+
273
+
274
+ <li class="public ">
275
+ <span class="summary_signature">
276
+
277
+ <a href="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong> &#x21d2; Boolean </a>
278
+
279
+
280
+
281
+ </span>
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+ <span class="summary_desc"><div class='inline'>
292
+ <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>
293
+ </div></span>
294
+
295
+ </li>
296
+
297
+
298
+ <li class="public ">
299
+ <span class="summary_signature">
300
+
301
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(*components) &#x21d2; Entity </a>
302
+
303
+
304
+
305
+ </span>
306
+
307
+
308
+ <span class="note title constructor">constructor</span>
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
+
317
+ <span class="summary_desc"><div class='inline'>
318
+ <p>Creating a new Entity.</p>
319
+ </div></span>
320
+
321
+ </li>
322
+
323
+
324
+ <li class="public ">
325
+ <span class="summary_signature">
326
+
327
+ <a href="#remove-instance_method" title="#remove (instance method)">#<strong>remove</strong>(*components_to_remove) &#x21d2; Boolean </a>
328
+
329
+
330
+
331
+ </span>
332
+
333
+
334
+
335
+
336
+
337
+
338
+
339
+
340
+
341
+ <span class="summary_desc"><div class='inline'>
342
+ <p>Remove a component from the Entity.</p>
343
+ </div></span>
344
+
345
+ </li>
346
+
347
+
348
+ <li class="public ">
349
+ <span class="summary_signature">
350
+
351
+ <a href="#to_i-instance_method" title="#to_i (instance method)">#<strong>to_i</strong> &#x21d2; Integer </a>
352
+
353
+
354
+
355
+ </span>
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+
364
+
365
+ <span class="summary_desc"><div class='inline'>
366
+ <p>An alias for the <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">ID reader</a></span>.</p>
367
+ </div></span>
368
+
369
+ </li>
370
+
371
+
372
+ </ul>
373
+
374
+
375
+
376
+ <div id="constructor_details" class="method_details_list">
377
+ <h2>Constructor Details</h2>
378
+
379
+ <div class="method_details first">
380
+ <h3 class="signature first" id="initialize-instance_method">
381
+
382
+ #<strong>initialize</strong>(*components) &#x21d2; <tt>Entity</tt>
383
+
384
+
385
+
386
+
387
+
388
+ </h3><div class="docstring">
389
+ <div class="discussion">
390
+
391
+ <p>Creating a new Entity</p>
392
+
393
+
394
+ </div>
395
+ </div>
396
+ <div class="tags">
397
+ <p class="tag_title">Parameters:</p>
398
+ <ul class="param">
399
+
400
+ <li>
401
+
402
+ <span class='name'>components</span>
403
+
404
+
405
+ <span class='type'>(<tt><span class='object_link'><a href="Components.html" title="FelFlame::Components (class)">Components</a></span></tt>)</span>
406
+
407
+
408
+
409
+ &mdash;
410
+ <div class='inline'>
411
+ <p>Can be any number of components, identical duplicates will be automatically purged however different components from the same component manager are allowed.</p>
412
+ </div>
413
+
414
+ </li>
415
+
416
+ </ul>
417
+
418
+
419
+ </div><table class="source_code">
420
+ <tr>
421
+ <td>
422
+ <pre class="lines">
423
+
424
+
425
+ 16
426
+ 17
427
+ 18
428
+ 19
429
+ 20
430
+ 21
431
+ 22
432
+ 23
433
+ 24
434
+ 25
435
+ 26</pre>
436
+ </td>
437
+ <td>
438
+ <pre class="code"><span class="info file"># File 'entity_manager.rb', line 16</span>
439
+
440
+ <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>
441
+ <span class='comment'># Assign new unique ID
442
+ </span> <span class='id identifier rubyid_new_id'>new_id</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_find_index'>find_index</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:nil?</span><span class='rparen'>)</span>
443
+ <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>
444
+ <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>
445
+
446
+ <span class='comment'># Add each component
447
+ </span> <span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_components'>components</span><span class='rparen'>)</span>
448
+
449
+ <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>
450
+ <span class='kw'>end</span></pre>
451
+ </td>
452
+ </tr>
453
+ </table>
454
+ </div>
455
+
456
+ </div>
457
+
458
+ <div id="instance_attr_details" class="attr_details">
459
+ <h2>Instance Attribute Details</h2>
460
+
461
+
462
+ <span id="id=-instance_method"></span>
463
+ <div class="method_details first">
464
+ <h3 class="signature first" id="id-instance_method">
465
+
466
+ #<strong>id</strong> &#x21d2; <tt>Integer</tt>
467
+
468
+
469
+
470
+
471
+
472
+ </h3><div class="docstring">
473
+ <div class="discussion">
474
+
475
+ <p>Holds the unique ID of this entity</p>
476
+
477
+
478
+ </div>
479
+ </div>
480
+ <div class="tags">
481
+
482
+ <p class="tag_title">Returns:</p>
483
+ <ul class="return">
484
+
485
+ <li>
486
+
487
+
488
+ <span class='type'>(<tt>Integer</tt>)</span>
489
+
490
+
491
+
492
+ </li>
493
+
494
+ </ul>
495
+
496
+ </div><table class="source_code">
497
+ <tr>
498
+ <td>
499
+ <pre class="lines">
500
+
501
+
502
+ 5
503
+ 6
504
+ 7</pre>
505
+ </td>
506
+ <td>
507
+ <pre class="code"><span class="info file"># File 'entity_manager.rb', line 5</span>
508
+
509
+ <span class='kw'>def</span> <span class='id identifier rubyid_id'>id</span>
510
+ <span class='ivar'>@id</span>
511
+ <span class='kw'>end</span></pre>
512
+ </td>
513
+ </tr>
514
+ </table>
515
+ </div>
516
+
517
+ </div>
518
+
519
+
520
+ <div id="class_method_details" class="method_details_list">
521
+ <h2>Class Method Details</h2>
522
+
523
+
524
+ <div class="method_details first">
525
+ <h3 class="signature first" id="[]-class_method">
526
+
527
+ .<strong>[]</strong>(entity_id) &#x21d2; <tt>Entity</tt>
528
+
529
+
530
+
531
+
532
+
533
+ </h3><div class="docstring">
534
+ <div class="discussion">
535
+
536
+ <p>Gets an Entity from the given <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">unique ID</a></span>. Usage is simular to how an Array lookup works</p>
537
+
538
+
539
+ </div>
540
+ </div>
541
+ <div class="tags">
542
+
543
+ <div class="examples">
544
+ <p class="tag_title">Examples:</p>
545
+
546
+
547
+ <pre class="example code"><code><span class='comment'># This gets the Entity with ID 7
548
+ </span><span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Entities (class)">Entities</a></span></span><span class='lbracket'>[</span><span class='int'>7</span><span class='rbracket'>]</span></code></pre>
549
+
550
+ </div>
551
+ <p class="tag_title">Parameters:</p>
552
+ <ul class="param">
553
+
554
+ <li>
555
+
556
+ <span class='name'>entity_id</span>
557
+
558
+
559
+ <span class='type'>(<tt>Integer</tt>)</span>
560
+
561
+
562
+
563
+ </li>
564
+
565
+ </ul>
566
+
567
+ <p class="tag_title">Returns:</p>
568
+ <ul class="return">
569
+
570
+ <li>
571
+
572
+
573
+ <span class='type'>(<tt>Entity</tt>)</span>
574
+
575
+
576
+
577
+ &mdash;
578
+ <div class='inline'>
579
+ <p>returns the Entity that uses the given unique ID, nil if there is no Entity associated with the given ID</p>
580
+ </div>
581
+
582
+ </li>
583
+
584
+ </ul>
585
+
586
+ </div><table class="source_code">
587
+ <tr>
588
+ <td>
589
+ <pre class="lines">
590
+
591
+
592
+ 117
593
+ 118
594
+ 119</pre>
595
+ </td>
596
+ <td>
597
+ <pre class="code"><span class="info file"># File 'entity_manager.rb', line 117</span>
598
+
599
+ <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>
600
+ <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>
601
+ <span class='kw'>end</span></pre>
602
+ </td>
603
+ </tr>
604
+ </table>
605
+ </div>
606
+
607
+ <div class="method_details ">
608
+ <h3 class="signature " id="each-class_method">
609
+
610
+ .<strong>each</strong>(&amp;block) &#x21d2; <tt>Enumerator</tt>
611
+
612
+
613
+
614
+
615
+
616
+ </h3><div class="docstring">
617
+ <div class="discussion">
618
+
619
+ <p>Iterates over all entities. The data is compacted so that means index does not correlate to ID. You also call other enumerable methods instead of each, such as <code>each_with_index</code> or <code>select</code></p>
620
+
621
+
622
+ </div>
623
+ </div>
624
+ <div class="tags">
625
+
626
+ <p class="tag_title">Returns:</p>
627
+ <ul class="return">
628
+
629
+ <li>
630
+
631
+
632
+ <span class='type'>(<tt>Enumerator</tt>)</span>
633
+
634
+
635
+
636
+ </li>
637
+
638
+ </ul>
639
+
640
+ </div><table class="source_code">
641
+ <tr>
642
+ <td>
643
+ <pre class="lines">
644
+
645
+
646
+ 124
647
+ 125
648
+ 126</pre>
649
+ </td>
650
+ <td>
651
+ <pre class="code"><span class="info file"># File 'entity_manager.rb', line 124</span>
652
+
653
+ <span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
654
+ <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
655
+ <span class='kw'>end</span></pre>
656
+ </td>
657
+ </tr>
658
+ </table>
659
+ </div>
660
+
661
+ </div>
662
+
663
+ <div id="instance_method_details" class="method_details_list">
664
+ <h2>Instance Method Details</h2>
665
+
666
+
667
+ <div class="method_details first">
668
+ <h3 class="signature first" id="add-instance_method">
669
+
670
+ #<strong>add</strong>(*components_to_add) &#x21d2; <tt>Boolean</tt>
671
+
672
+
673
+
674
+
675
+
676
+ </h3><div class="docstring">
677
+ <div class="discussion">
678
+
679
+ <p>Add any number components to the Entity.</p>
680
+
681
+
682
+ </div>
683
+ </div>
684
+ <div class="tags">
685
+ <p class="tag_title">Parameters:</p>
686
+ <ul class="param">
687
+
688
+ <li>
689
+
690
+ <span class='name'>components_to_add</span>
691
+
692
+
693
+ <span class='type'>(<tt>Component</tt>)</span>
694
+
695
+
696
+
697
+ &mdash;
698
+ <div class='inline'>
699
+ <p>Any number of components created from any component manager</p>
700
+ </div>
701
+
702
+ </li>
703
+
704
+ </ul>
705
+
706
+ <p class="tag_title">Returns:</p>
707
+ <ul class="return">
708
+
709
+ <li>
710
+
711
+
712
+ <span class='type'>(<tt>Boolean</tt>)</span>
713
+
714
+
715
+
716
+ &mdash;
717
+ <div class='inline'>
718
+ <p><code>true</code></p>
719
+ </div>
720
+
721
+ </li>
722
+
723
+ </ul>
724
+
725
+ </div><table class="source_code">
726
+ <tr>
727
+ <td>
728
+ <pre class="lines">
729
+
730
+
731
+ 58
732
+ 59
733
+ 60
734
+ 61
735
+ 62
736
+ 63
737
+ 64
738
+ 65
739
+ 66
740
+ 67
741
+ 68
742
+ 69
743
+ 70
744
+ 71</pre>
745
+ </td>
746
+ <td>
747
+ <pre class="code"><span class="info file"># File 'entity_manager.rb', line 58</span>
748
+
749
+ <span class='kw'>def</span> <span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_components_to_add'>components_to_add</span><span class='rparen'>)</span>
750
+ <span class='id identifier rubyid_components_to_add'>components_to_add</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span>
751
+ <span class='kw'>if</span> <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
752
+ <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbracket'>]</span>
753
+ <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_id'>id</span>
754
+ <span class='id identifier rubyid_check_systems'>check_systems</span> <span class='id identifier rubyid_component'>component</span><span class='comma'>,</span> <span class='symbol'>:addition_triggers</span>
755
+ <span class='kw'>elsif</span> <span class='op'>!</span><span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
756
+ <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
757
+ <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_id'>id</span>
758
+ <span class='id identifier rubyid_check_systems'>check_systems</span> <span class='id identifier rubyid_component'>component</span><span class='comma'>,</span> <span class='symbol'>:addition_triggers</span>
759
+ <span class='kw'>end</span>
760
+ <span class='kw'>end</span>
761
+ <span class='kw'>true</span>
762
+ <span class='kw'>end</span></pre>
763
+ </td>
764
+ </tr>
765
+ </table>
766
+ </div>
767
+
768
+ <div class="method_details ">
769
+ <h3 class="signature " id="components-instance_method">
770
+
771
+ #<strong>components</strong> &#x21d2; <tt>Hash&lt;Component_Manager, Array&lt;Integer&gt;&gt;</tt>
772
+
773
+
774
+
775
+
776
+
777
+ </h3><div class="docstring">
778
+ <div class="discussion">
779
+
780
+ <p>A hash that uses component manager constant names as keys, and where the values of those keys are arrays that contain the <span class='object_link'><a href="ComponentManager.html#id-instance_method" title="FelFlame::ComponentManager#id (method)">IDs</a></span> of the components attached to this entity.</p>
781
+
782
+
783
+ </div>
784
+ </div>
785
+ <div class="tags">
786
+
787
+ <p class="tag_title">Returns:</p>
788
+ <ul class="return">
789
+
790
+ <li>
791
+
792
+
793
+ <span class='type'>(<tt>Hash&lt;Component_Manager, Array&lt;Integer&gt;&gt;</tt>)</span>
794
+
795
+
796
+
797
+ </li>
798
+
799
+ </ul>
800
+
801
+ </div><table class="source_code">
802
+ <tr>
803
+ <td>
804
+ <pre class="lines">
805
+
806
+
807
+ 30
808
+ 31
809
+ 32</pre>
810
+ </td>
811
+ <td>
812
+ <pre class="code"><span class="info file"># File 'entity_manager.rb', line 30</span>
813
+
814
+ <span class='kw'>def</span> <span class='id identifier rubyid_components'>components</span>
815
+ <span class='ivar'>@components</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
816
+ <span class='kw'>end</span></pre>
817
+ </td>
818
+ </tr>
819
+ </table>
820
+ </div>
821
+
822
+ <div class="method_details ">
823
+ <h3 class="signature " id="delete-instance_method">
824
+
825
+ #<strong>delete</strong> &#x21d2; <tt>Boolean</tt>
826
+
827
+
828
+
829
+
830
+
831
+ </h3><div class="docstring">
832
+ <div class="discussion">
833
+
834
+ <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>
835
+
836
+
837
+ </div>
838
+ </div>
839
+ <div class="tags">
840
+
841
+ <p class="tag_title">Returns:</p>
842
+ <ul class="return">
843
+
844
+ <li>
845
+
846
+
847
+ <span class='type'>(<tt>Boolean</tt>)</span>
848
+
849
+
850
+
851
+ &mdash;
852
+ <div class='inline'>
853
+ <p><code>true</code></p>
854
+ </div>
855
+
856
+ </li>
857
+
858
+ </ul>
859
+
860
+ </div><table class="source_code">
861
+ <tr>
862
+ <td>
863
+ <pre class="lines">
864
+
865
+
866
+ 42
867
+ 43
868
+ 44
869
+ 45
870
+ 46
871
+ 47
872
+ 48
873
+ 49
874
+ 50
875
+ 51
876
+ 52
877
+ 53</pre>
878
+ </td>
879
+ <td>
880
+ <pre class="code"><span class="info file"># File 'entity_manager.rb', line 42</span>
881
+
882
+ <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
883
+ <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>
884
+ <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>
885
+ <span class='id identifier rubyid_component_manager'>component_manager</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_entities'>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>
886
+ <span class='comment'>#self.remove FelFlame::Components.const_get(component_manager.name)[component_id]
887
+ </span> <span class='kw'>end</span>
888
+ <span class='kw'>end</span>
889
+ <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>
890
+ <span class='ivar'>@components</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
891
+ <span class='ivar'>@id</span> <span class='op'>=</span> <span class='kw'>nil</span>
892
+ <span class='kw'>true</span>
893
+ <span class='kw'>end</span></pre>
894
+ </td>
895
+ </tr>
896
+ </table>
897
+ </div>
898
+
899
+ <div class="method_details ">
900
+ <h3 class="signature " id="remove-instance_method">
901
+
902
+ #<strong>remove</strong>(*components_to_remove) &#x21d2; <tt>Boolean</tt>
903
+
904
+
905
+
906
+
907
+
908
+ </h3><div class="docstring">
909
+ <div class="discussion">
910
+
911
+ <p>Remove a component from the Entity</p>
912
+
913
+
914
+ </div>
915
+ </div>
916
+ <div class="tags">
917
+ <p class="tag_title">Parameters:</p>
918
+ <ul class="param">
919
+
920
+ <li>
921
+
922
+ <span class='name'>components_to_remove</span>
923
+
924
+
925
+ <span class='type'>(<tt>Component</tt>)</span>
926
+
927
+
928
+
929
+ &mdash;
930
+ <div class='inline'>
931
+ <p>A component created from any component manager</p>
932
+ </div>
933
+
934
+ </li>
935
+
936
+ </ul>
937
+
938
+ <p class="tag_title">Returns:</p>
939
+ <ul class="return">
940
+
941
+ <li>
942
+
943
+
944
+ <span class='type'>(<tt>Boolean</tt>)</span>
945
+
946
+
947
+
948
+ &mdash;
949
+ <div class='inline'>
950
+ <p><code>true</code></p>
951
+ </div>
952
+
953
+ </li>
954
+
955
+ </ul>
956
+
957
+ </div><table class="source_code">
958
+ <tr>
959
+ <td>
960
+ <pre class="lines">
961
+
962
+
963
+ 88
964
+ 89
965
+ 90
966
+ 91
967
+ 92
968
+ 93
969
+ 94
970
+ 95</pre>
971
+ </td>
972
+ <td>
973
+ <pre class="code"><span class="info file"># File 'entity_manager.rb', line 88</span>
974
+
975
+ <span class='kw'>def</span> <span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_components_to_remove'>components_to_remove</span><span class='rparen'>)</span>
976
+ <span class='id identifier rubyid_components_to_remove'>components_to_remove</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span>
977
+ <span class='id identifier rubyid_check_systems'>check_systems</span> <span class='id identifier rubyid_component'>component</span><span class='comma'>,</span> <span class='symbol'>:removal_triggers</span> <span class='kw'>if</span> <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_id'>id</span>
978
+ <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_id'>id</span>
979
+ <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
980
+ <span class='kw'>end</span>
981
+ <span class='kw'>true</span>
982
+ <span class='kw'>end</span></pre>
983
+ </td>
984
+ </tr>
985
+ </table>
986
+ </div>
987
+
988
+ <div class="method_details ">
989
+ <h3 class="signature " id="to_i-instance_method">
990
+
991
+ #<strong>to_i</strong> &#x21d2; <tt>Integer</tt>
992
+
993
+
994
+
995
+
996
+
997
+ </h3><div class="docstring">
998
+ <div class="discussion">
999
+
1000
+ <p>An alias for the <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">ID reader</a></span></p>
1001
+
1002
+
1003
+ </div>
1004
+ </div>
1005
+ <div class="tags">
1006
+
1007
+ <p class="tag_title">Returns:</p>
1008
+ <ul class="return">
1009
+
1010
+ <li>
1011
+
1012
+
1013
+ <span class='type'>(<tt>Integer</tt>)</span>
1014
+
1015
+
1016
+
1017
+ </li>
1018
+
1019
+ </ul>
1020
+
1021
+ </div><table class="source_code">
1022
+ <tr>
1023
+ <td>
1024
+ <pre class="lines">
1025
+
1026
+
1027
+ 36
1028
+ 37
1029
+ 38</pre>
1030
+ </td>
1031
+ <td>
1032
+ <pre class="code"><span class="info file"># File 'entity_manager.rb', line 36</span>
1033
+
1034
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_i'>to_i</span>
1035
+ <span class='id identifier rubyid_id'>id</span>
1036
+ <span class='kw'>end</span></pre>
1037
+ </td>
1038
+ </tr>
1039
+ </table>
1040
+ </div>
1041
+
1042
+ </div>
1043
+
1044
+ </div>
1045
+
1046
+ <div id="footer">
1047
+ Generated on Fri Jul 9 01:56:54 2021 by
1048
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1049
+ 0.9.26 (ruby-2.7.3).
1050
+ </div>
1051
+
1052
+ </div>
1053
+ </body>
1054
+ </html>