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,1541 @@
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::Systems
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::Systems";
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 (S)</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">Systems</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::Systems
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::Systems</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
+ system_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 an manages Systems. Systems are the logic of the game and do not contain any data within them.</p>
113
+
114
+ <p>TODO: Improve Systems overview</p>
115
+
116
+
117
+ </div>
118
+ </div>
119
+ <div class="tags">
120
+
121
+
122
+ </div>
123
+
124
+
125
+
126
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
127
+ <ul class="summary">
128
+
129
+ <li class="public ">
130
+ <span class="summary_signature">
131
+
132
+ <a href="#addition_triggers-instance_method" title="#addition_triggers (instance method)">#<strong>addition_triggers</strong> &#x21d2; Array&lt;Component&gt; </a>
133
+
134
+
135
+
136
+ </span>
137
+
138
+
139
+
140
+
141
+ <span class="note title readonly">readonly</span>
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+ <span class="summary_desc"><div class='inline'>
152
+ <p>Stores references to components or their managers that trigger this component when a component or component from that manager is added to an entity.</p>
153
+ </div></span>
154
+
155
+ </li>
156
+
157
+
158
+ <li class="public ">
159
+ <span class="summary_signature">
160
+
161
+ <a href="#attr_triggers-instance_method" title="#attr_triggers (instance method)">#<strong>attr_triggers</strong> &#x21d2; Hash&lt;Symbol, Array&lt;Symbol&gt;&gt; </a>
162
+
163
+
164
+
165
+ </span>
166
+
167
+
168
+
169
+
170
+ <span class="note title readonly">readonly</span>
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+ <span class="summary_desc"><div class='inline'>
181
+ <p>Stores references to systems that should be triggered when an attribute from this manager is changed Do not edit this hash as it is managed by FelFlame automatically.</p>
182
+ </div></span>
183
+
184
+ </li>
185
+
186
+
187
+ <li class="public ">
188
+ <span class="summary_signature">
189
+
190
+ <a href="#const_name-instance_method" title="#const_name (instance method)">#<strong>const_name</strong> &#x21d2; Object </a>
191
+
192
+
193
+
194
+ </span>
195
+
196
+
197
+
198
+
199
+ <span class="note title readonly">readonly</span>
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+ <span class="summary_desc"><div class='inline'>
210
+ <p>The Constant name assigned to this System.</p>
211
+ </div></span>
212
+
213
+ </li>
214
+
215
+
216
+ <li class="public ">
217
+ <span class="summary_signature">
218
+
219
+ <a href="#priority-instance_method" title="#priority (instance method)">#<strong>priority</strong> &#x21d2; Object </a>
220
+
221
+
222
+
223
+ </span>
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+ <span class="summary_desc"><div class='inline'>
237
+ <p>How early this System should be executed in a list of Systems.</p>
238
+ </div></span>
239
+
240
+ </li>
241
+
242
+
243
+ <li class="public ">
244
+ <span class="summary_signature">
245
+
246
+ <a href="#removal_triggers-instance_method" title="#removal_triggers (instance method)">#<strong>removal_triggers</strong> &#x21d2; Array&lt;Component&gt; </a>
247
+
248
+
249
+
250
+ </span>
251
+
252
+
253
+
254
+
255
+ <span class="note title readonly">readonly</span>
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+ <span class="summary_desc"><div class='inline'>
266
+ <p>Stores references to components or their managers that trigger this component when a component or component from that manager is removed from an entity.</p>
267
+ </div></span>
268
+
269
+ </li>
270
+
271
+
272
+ </ul>
273
+
274
+
275
+
276
+
277
+
278
+ <h2>
279
+ Class Method Summary
280
+ <small><a href="#" class="summary_toggle">collapse</a></small>
281
+ </h2>
282
+
283
+ <ul class="summary">
284
+
285
+ <li class="public ">
286
+ <span class="summary_signature">
287
+
288
+ <a href="#each-class_method" title="each (class method)">.<strong>each</strong>(&amp;block) &#x21d2; Enumerator </a>
289
+
290
+
291
+
292
+ </span>
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+ <span class="summary_desc"><div class='inline'>
303
+ <p>Iterate over all Systems, sorted by their priority.</p>
304
+ </div></span>
305
+
306
+ </li>
307
+
308
+
309
+ </ul>
310
+
311
+ <h2>
312
+ Instance Method Summary
313
+ <small><a href="#" class="summary_toggle">collapse</a></small>
314
+ </h2>
315
+
316
+ <ul class="summary">
317
+
318
+ <li class="public ">
319
+ <span class="summary_signature">
320
+
321
+ <a href="#call-instance_method" title="#call (instance method)">#<strong>call</strong> &#x21d2; Object </a>
322
+
323
+
324
+
325
+ </span>
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+
335
+ <span class="summary_desc"><div class='inline'>
336
+ <p>Manually execute the system a single time.</p>
337
+ </div></span>
338
+
339
+ </li>
340
+
341
+
342
+ <li class="public ">
343
+ <span class="summary_signature">
344
+
345
+ <a href="#clear_triggers-instance_method" title="#clear_triggers (instance method)">#<strong>clear_triggers</strong>(*trigger_types, component_or_manager: nil) &#x21d2; Boolean </a>
346
+
347
+
348
+
349
+ </span>
350
+
351
+
352
+
353
+
354
+
355
+
356
+
357
+
358
+
359
+ <span class="summary_desc"><div class='inline'>
360
+ <p>Removes triggers from this system.</p>
361
+ </div></span>
362
+
363
+ </li>
364
+
365
+
366
+ <li class="public ">
367
+ <span class="summary_signature">
368
+
369
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(name, priority: 0, &amp;block) &#x21d2; Systems </a>
370
+
371
+
372
+
373
+ </span>
374
+
375
+
376
+ <span class="note title constructor">constructor</span>
377
+
378
+
379
+
380
+
381
+
382
+
383
+
384
+
385
+ <span class="summary_desc"><div class='inline'>
386
+ <p>Creates a new System which can be accessed as a constant under the namespace <span class='object_link'><a href="" title="FelFlame::Systems (class)">Systems</a></span>.</p>
387
+ </div></span>
388
+
389
+ </li>
390
+
391
+
392
+ <li class="public ">
393
+ <span class="summary_signature">
394
+
395
+ <a href="#redefine-instance_method" title="#redefine (instance method)">#<strong>redefine</strong>(&amp;block) &#x21d2; Object </a>
396
+
397
+
398
+
399
+ </span>
400
+
401
+
402
+
403
+
404
+
405
+
406
+
407
+
408
+
409
+ <span class="summary_desc"><div class='inline'>
410
+ <p>Redefine what code is executed by this System when it is called upon.</p>
411
+ </div></span>
412
+
413
+ </li>
414
+
415
+
416
+ <li class="public ">
417
+ <span class="summary_signature">
418
+
419
+ <a href="#trigger_when_added-instance_method" title="#trigger_when_added (instance method)">#<strong>trigger_when_added</strong>(component_or_manager) &#x21d2; Boolean </a>
420
+
421
+
422
+
423
+ </span>
424
+
425
+
426
+
427
+
428
+
429
+
430
+
431
+
432
+
433
+ <span class="summary_desc"><div class='inline'>
434
+ <p>Add a component or component manager so that it triggers this system when the component or a component from the component manager is added to an entity.</p>
435
+ </div></span>
436
+
437
+ </li>
438
+
439
+
440
+ <li class="public ">
441
+ <span class="summary_signature">
442
+
443
+ <a href="#trigger_when_is_changed-instance_method" title="#trigger_when_is_changed (instance method)">#<strong>trigger_when_is_changed</strong>(component_or_manager, attr) &#x21d2; Boolean </a>
444
+
445
+
446
+
447
+ </span>
448
+
449
+
450
+
451
+
452
+
453
+
454
+
455
+
456
+
457
+ <span class="summary_desc"><div class='inline'>
458
+ <p>Add a component or component manager so that it triggers this system when a component&#39;s attribute is changed.</p>
459
+ </div></span>
460
+
461
+ </li>
462
+
463
+
464
+ <li class="public ">
465
+ <span class="summary_signature">
466
+
467
+ <a href="#trigger_when_removed-instance_method" title="#trigger_when_removed (instance method)">#<strong>trigger_when_removed</strong>(component_or_manager) &#x21d2; Boolean </a>
468
+
469
+
470
+
471
+ </span>
472
+
473
+
474
+
475
+
476
+
477
+
478
+
479
+
480
+
481
+ <span class="summary_desc"><div class='inline'>
482
+ <p>Add a component or component manager so that it triggers this system when the component or a component from the component manager is removed from an entity.</p>
483
+ </div></span>
484
+
485
+ </li>
486
+
487
+
488
+ </ul>
489
+
490
+
491
+
492
+ <div id="constructor_details" class="method_details_list">
493
+ <h2>Constructor Details</h2>
494
+
495
+ <div class="method_details first">
496
+ <h3 class="signature first" id="initialize-instance_method">
497
+
498
+ #<strong>initialize</strong>(name, priority: 0, &amp;block) &#x21d2; <tt><span class='object_link'><a href="" title="FelFlame::Systems (class)">Systems</a></span></tt>
499
+
500
+
501
+
502
+
503
+
504
+ </h3><div class="docstring">
505
+ <div class="discussion">
506
+
507
+ <p>Creates a new System which can be accessed as a constant under the namespace <span class='object_link'><a href="" title="FelFlame::Systems (class)">FelFlame::Systems</a></span>. The name given is what constant the system is assigned to</p>
508
+
509
+
510
+ </div>
511
+ </div>
512
+ <div class="tags">
513
+
514
+ <div class="examples">
515
+ <p class="tag_title">Examples:</p>
516
+
517
+
518
+ <pre class="example code"><code><span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Systems (class)">Systems</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>PassiveHeal</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>priority:</span> <span class='op'>-</span><span class='int'>2</span><span class='rparen'>)</span> <span class='kw'>do</span>
519
+ <span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Health</span><span class='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>
520
+ <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_hp'>hp</span> <span class='op'>+=</span> <span class='int'>5</span>
521
+ <span class='kw'>end</span>
522
+ <span class='kw'>end</span>
523
+ <span class='comment'># Give it a low priority so other systems such as a
524
+ </span><span class='comment'># Poison system would kill the player first</span></code></pre>
525
+
526
+ </div>
527
+ <p class="tag_title">Parameters:</p>
528
+ <ul class="param">
529
+
530
+ <li>
531
+
532
+ <span class='name'>name</span>
533
+
534
+
535
+ <span class='type'>(<tt>String</tt>)</span>
536
+
537
+
538
+
539
+ &mdash;
540
+ <div class='inline'>
541
+ <p>The name this system will use. Needs to to be in the Ruby Constant format.</p>
542
+ </div>
543
+
544
+ </li>
545
+
546
+ <li>
547
+
548
+ <span class='name'>priority</span>
549
+
550
+
551
+ <span class='type'>(<tt>Integer</tt>)</span>
552
+
553
+
554
+ <em class="default">(defaults to: <tt>0</tt>)</em>
555
+
556
+
557
+ &mdash;
558
+ <div class='inline'>
559
+ <p>Which priority order this system should be executed in relative to other systems. Higher means executed earlier.</p>
560
+ </div>
561
+
562
+ </li>
563
+
564
+ <li>
565
+
566
+ <span class='name'>block</span>
567
+
568
+
569
+ <span class='type'>(<tt>Proc</tt>)</span>
570
+
571
+
572
+
573
+ &mdash;
574
+ <div class='inline'>
575
+ <p>The code you wish to be executed when the system is triggered. Can be defined by using a <tt>do end</tt> block or using <tt>{ }</tt> braces.</p>
576
+ </div>
577
+
578
+ </li>
579
+
580
+ </ul>
581
+
582
+
583
+ </div><table class="source_code">
584
+ <tr>
585
+ <td>
586
+ <pre class="lines">
587
+
588
+
589
+ 71
590
+ 72
591
+ 73
592
+ 74
593
+ 75
594
+ 76</pre>
595
+ </td>
596
+ <td>
597
+ <pre class="code"><span class="info file"># File 'system_manager.rb', line 71</span>
598
+
599
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='label'>priority:</span> <span class='int'>0</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
600
+ <span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Systems (class)">Systems</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_set'>const_set</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='kw'>self</span><span class='rparen'>)</span>
601
+ <span class='ivar'>@const_name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
602
+ <span class='ivar'>@priority</span> <span class='op'>=</span> <span class='id identifier rubyid_priority'>priority</span>
603
+ <span class='ivar'>@block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
604
+ <span class='kw'>end</span></pre>
605
+ </td>
606
+ </tr>
607
+ </table>
608
+ </div>
609
+
610
+ </div>
611
+
612
+ <div id="instance_attr_details" class="attr_details">
613
+ <h2>Instance Attribute Details</h2>
614
+
615
+
616
+ <span id="addition_triggers=-instance_method"></span>
617
+ <div class="method_details first">
618
+ <h3 class="signature first" id="addition_triggers-instance_method">
619
+
620
+ #<strong>addition_triggers</strong> &#x21d2; <tt>Array&lt;Component&gt;</tt>
621
+
622
+
623
+
624
+
625
+
626
+ </h3><div class="docstring">
627
+ <div class="discussion">
628
+
629
+ <p>Stores references to components or their managers that trigger this component when a component or component from that manager is added to an entity. Do not edit this hash as it is managed by FelFlame automatically.</p>
630
+
631
+
632
+ </div>
633
+ </div>
634
+ <div class="tags">
635
+
636
+ <p class="tag_title">Returns:</p>
637
+ <ul class="return">
638
+
639
+ <li>
640
+
641
+
642
+ <span class='type'>(<tt>Array&lt;Component&gt;</tt>)</span>
643
+
644
+
645
+
646
+ </li>
647
+
648
+ </ul>
649
+
650
+ </div><table class="source_code">
651
+ <tr>
652
+ <td>
653
+ <pre class="lines">
654
+
655
+
656
+ 24
657
+ 25
658
+ 26</pre>
659
+ </td>
660
+ <td>
661
+ <pre class="code"><span class="info file"># File 'system_manager.rb', line 24</span>
662
+
663
+ <span class='kw'>def</span> <span class='id identifier rubyid_addition_triggers'>addition_triggers</span>
664
+ <span class='ivar'>@addition_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
665
+ <span class='kw'>end</span></pre>
666
+ </td>
667
+ </tr>
668
+ </table>
669
+ </div>
670
+
671
+
672
+ <span id="attr_triggers=-instance_method"></span>
673
+ <div class="method_details ">
674
+ <h3 class="signature " id="attr_triggers-instance_method">
675
+
676
+ #<strong>attr_triggers</strong> &#x21d2; <tt>Hash&lt;Symbol, Array&lt;Symbol&gt;&gt;</tt>
677
+
678
+
679
+
680
+
681
+
682
+ </h3><div class="docstring">
683
+ <div class="discussion">
684
+
685
+ <p>Stores references to systems that should be triggered when an attribute from this manager is changed Do not edit this hash as it is managed by FelFlame automatically.</p>
686
+
687
+
688
+ </div>
689
+ </div>
690
+ <div class="tags">
691
+
692
+ <p class="tag_title">Returns:</p>
693
+ <ul class="return">
694
+
695
+ <li>
696
+
697
+
698
+ <span class='type'>(<tt>Hash&lt;Symbol, Array&lt;Symbol&gt;&gt;</tt>)</span>
699
+
700
+
701
+
702
+ </li>
703
+
704
+ </ul>
705
+
706
+ </div><table class="source_code">
707
+ <tr>
708
+ <td>
709
+ <pre class="lines">
710
+
711
+
712
+ 42
713
+ 43
714
+ 44</pre>
715
+ </td>
716
+ <td>
717
+ <pre class="code"><span class="info file"># File 'system_manager.rb', line 42</span>
718
+
719
+ <span class='kw'>def</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span>
720
+ <span class='ivar'>@attr_triggers</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
721
+ <span class='kw'>end</span></pre>
722
+ </td>
723
+ </tr>
724
+ </table>
725
+ </div>
726
+
727
+
728
+ <span id=""></span>
729
+ <div class="method_details ">
730
+ <h3 class="signature " id="const_name-instance_method">
731
+
732
+ #<strong>const_name</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
733
+
734
+
735
+
736
+
737
+
738
+ </h3><div class="docstring">
739
+ <div class="discussion">
740
+
741
+ <p>The Constant name assigned to this System</p>
742
+
743
+
744
+ </div>
745
+ </div>
746
+ <div class="tags">
747
+
748
+
749
+ </div><table class="source_code">
750
+ <tr>
751
+ <td>
752
+ <pre class="lines">
753
+
754
+
755
+ 7
756
+ 8
757
+ 9</pre>
758
+ </td>
759
+ <td>
760
+ <pre class="code"><span class="info file"># File 'system_manager.rb', line 7</span>
761
+
762
+ <span class='kw'>def</span> <span class='id identifier rubyid_const_name'>const_name</span>
763
+ <span class='ivar'>@const_name</span>
764
+ <span class='kw'>end</span></pre>
765
+ </td>
766
+ </tr>
767
+ </table>
768
+ </div>
769
+
770
+
771
+ <span id="priority=-instance_method"></span>
772
+ <div class="method_details ">
773
+ <h3 class="signature " id="priority-instance_method">
774
+
775
+ #<strong>priority</strong> &#x21d2; <tt>Object</tt>
776
+
777
+
778
+
779
+
780
+
781
+ </h3><div class="docstring">
782
+ <div class="discussion">
783
+
784
+ <p>How early this System should be executed in a list of Systems</p>
785
+
786
+
787
+ </div>
788
+ </div>
789
+ <div class="tags">
790
+
791
+
792
+ </div><table class="source_code">
793
+ <tr>
794
+ <td>
795
+ <pre class="lines">
796
+
797
+
798
+ 4
799
+ 5
800
+ 6</pre>
801
+ </td>
802
+ <td>
803
+ <pre class="code"><span class="info file"># File 'system_manager.rb', line 4</span>
804
+
805
+ <span class='kw'>def</span> <span class='id identifier rubyid_priority'>priority</span>
806
+ <span class='ivar'>@priority</span>
807
+ <span class='kw'>end</span></pre>
808
+ </td>
809
+ </tr>
810
+ </table>
811
+ </div>
812
+
813
+
814
+ <span id="removal_triggers=-instance_method"></span>
815
+ <div class="method_details ">
816
+ <h3 class="signature " id="removal_triggers-instance_method">
817
+
818
+ #<strong>removal_triggers</strong> &#x21d2; <tt>Array&lt;Component&gt;</tt>
819
+
820
+
821
+
822
+
823
+
824
+ </h3><div class="docstring">
825
+ <div class="discussion">
826
+
827
+ <p>Stores references to components or their managers that trigger this component when a component or component from that manager is removed from an entity. Do not edit this hash as it is managed by FelFlame automatically.</p>
828
+
829
+
830
+ </div>
831
+ </div>
832
+ <div class="tags">
833
+
834
+ <p class="tag_title">Returns:</p>
835
+ <ul class="return">
836
+
837
+ <li>
838
+
839
+
840
+ <span class='type'>(<tt>Array&lt;Component&gt;</tt>)</span>
841
+
842
+
843
+
844
+ </li>
845
+
846
+ </ul>
847
+
848
+ </div><table class="source_code">
849
+ <tr>
850
+ <td>
851
+ <pre class="lines">
852
+
853
+
854
+ 33
855
+ 34
856
+ 35</pre>
857
+ </td>
858
+ <td>
859
+ <pre class="code"><span class="info file"># File 'system_manager.rb', line 33</span>
860
+
861
+ <span class='kw'>def</span> <span class='id identifier rubyid_removal_triggers'>removal_triggers</span>
862
+ <span class='ivar'>@removal_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
863
+ <span class='kw'>end</span></pre>
864
+ </td>
865
+ </tr>
866
+ </table>
867
+ </div>
868
+
869
+ </div>
870
+
871
+
872
+ <div id="class_method_details" class="method_details_list">
873
+ <h2>Class Method Details</h2>
874
+
875
+
876
+ <div class="method_details first">
877
+ <h3 class="signature first" id="each-class_method">
878
+
879
+ .<strong>each</strong>(&amp;block) &#x21d2; <tt>Enumerator</tt>
880
+
881
+
882
+
883
+
884
+
885
+ </h3><div class="docstring">
886
+ <div class="discussion">
887
+
888
+ <p>Iterate over all Systems, sorted by their priority. You also call other enumerable methods instead of each, such as <code>each_with_index</code> or <code>select</code></p>
889
+
890
+
891
+ </div>
892
+ </div>
893
+ <div class="tags">
894
+
895
+ <p class="tag_title">Returns:</p>
896
+ <ul class="return">
897
+
898
+ <li>
899
+
900
+
901
+ <span class='type'>(<tt>Enumerator</tt>)</span>
902
+
903
+
904
+
905
+ </li>
906
+
907
+ </ul>
908
+
909
+ </div><table class="source_code">
910
+ <tr>
911
+ <td>
912
+ <pre class="lines">
913
+
914
+
915
+ 51
916
+ 52
917
+ 53</pre>
918
+ </td>
919
+ <td>
920
+ <pre class="code"><span class="info file"># File 'system_manager.rb', line 51</span>
921
+
922
+ <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>
923
+ <span class='id identifier rubyid_constants'>constants</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_sym'>sym</span><span class='op'>|</span> <span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_sym'>sym</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_sort_by'>sort_by</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:priority</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_reverse'>reverse</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
924
+ <span class='kw'>end</span></pre>
925
+ </td>
926
+ </tr>
927
+ </table>
928
+ </div>
929
+
930
+ </div>
931
+
932
+ <div id="instance_method_details" class="method_details_list">
933
+ <h2>Instance Method Details</h2>
934
+
935
+
936
+ <div class="method_details first">
937
+ <h3 class="signature first" id="call-instance_method">
938
+
939
+ #<strong>call</strong> &#x21d2; <tt>Object</tt>
940
+
941
+
942
+
943
+
944
+
945
+ </h3><div class="docstring">
946
+ <div class="discussion">
947
+
948
+ <p>Manually execute the system a single time</p>
949
+
950
+
951
+ </div>
952
+ </div>
953
+ <div class="tags">
954
+
955
+
956
+ </div><table class="source_code">
957
+ <tr>
958
+ <td>
959
+ <pre class="lines">
960
+
961
+
962
+ 79
963
+ 80
964
+ 81</pre>
965
+ </td>
966
+ <td>
967
+ <pre class="code"><span class="info file"># File 'system_manager.rb', line 79</span>
968
+
969
+ <span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span>
970
+ <span class='ivar'>@block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
971
+ <span class='kw'>end</span></pre>
972
+ </td>
973
+ </tr>
974
+ </table>
975
+ </div>
976
+
977
+ <div class="method_details ">
978
+ <h3 class="signature " id="clear_triggers-instance_method">
979
+
980
+ #<strong>clear_triggers</strong>(*trigger_types, component_or_manager: nil) &#x21d2; <tt>Boolean</tt>
981
+
982
+
983
+
984
+
985
+
986
+ </h3><div class="docstring">
987
+ <div class="discussion">
988
+
989
+ <p>Removes triggers from this system. This function is fairly flexible so it can accept a few different inputs For addition and removal triggers, you can optionally pass in a component, or a manager to clear specifically the relevant triggers for that one component or manager. If you do not pass a component or manager then it will clear triggers for all components and managers. For attr_triggers</p>
990
+
991
+
992
+ </div>
993
+ </div>
994
+ <div class="tags">
995
+
996
+ <div class="examples">
997
+ <p class="tag_title">Examples:</p>
998
+
999
+
1000
+ <pre class="example code"><code><span class='comment'># To clear all triggers that execute this system when a component is added:
1001
+ </span><span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>ExampleSystem</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span> <span class='symbol'>:addition_triggers</span>
1002
+ <span class='comment'># Same as above but for when a component is removed instead
1003
+ </span><span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>ExampleSystem</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span> <span class='symbol'>:removal_triggers</span>
1004
+ <span class='comment'># Same as above but for when a component has a certain attribute changed
1005
+ </span><span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>ExampleSystem</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span> <span class='symbol'>:attr_triggers</span>
1006
+
1007
+ <span class='comment'># Clear a trigger from a specific component
1008
+ </span><span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>ExampleSystem</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span> <span class='symbol'>:addition_triggers</span><span class='comma'>,</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='op'>::</span><span class='const'>ExampleComponent</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
1009
+ <span class='comment'># Clear a trigger from a specific component manager
1010
+ </span><span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>ExampleSystem</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span> <span class='symbol'>:addition_triggers</span><span class='comma'>,</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='op'>::</span><span class='const'>ExampleComponent</span>
1011
+
1012
+ <span class='comment'># Clear the trigger that executes a system when the &#39;:example_attr&#39; is changes
1013
+ </span><span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>ExampleSystem</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span> <span class='symbol'>:attr_triggers</span><span class='comma'>,</span> <span class='symbol'>:example_attr</span></code></pre>
1014
+
1015
+ </div>
1016
+ <p class="tag_title">Parameters:</p>
1017
+ <ul class="param">
1018
+
1019
+ <li>
1020
+
1021
+ <span class='name'>trigger_types</span>
1022
+
1023
+
1024
+ <span class='type'>(<tt>:Symbols</tt>)</span>
1025
+
1026
+
1027
+
1028
+ &mdash;
1029
+ <div class='inline'>
1030
+ <p>One or more of the following trigger types: <code>:addition_triggers</code>, <code>:removal_triggers</code>, or <code>:attr_triggers</code>. If attr_triggers is used then you may pass attributes you wish to be cleared as symbols in this parameter as well</p>
1031
+ </div>
1032
+
1033
+ </li>
1034
+
1035
+ <li>
1036
+
1037
+ <span class='name'>component_or_manager</span>
1038
+
1039
+
1040
+ <span class='type'>(<tt>Component or <span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span></tt>)</span>
1041
+
1042
+
1043
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
1044
+
1045
+
1046
+ &mdash;
1047
+ <div class='inline'>
1048
+ <p>The object to clear triggers from. Use Nil to clear triggers from all components associated with this system.</p>
1049
+ </div>
1050
+
1051
+ </li>
1052
+
1053
+ </ul>
1054
+
1055
+ <p class="tag_title">Returns:</p>
1056
+ <ul class="return">
1057
+
1058
+ <li>
1059
+
1060
+
1061
+ <span class='type'>(<tt>Boolean</tt>)</span>
1062
+
1063
+
1064
+
1065
+ &mdash;
1066
+ <div class='inline'>
1067
+ <p><code>true</code></p>
1068
+ </div>
1069
+
1070
+ </li>
1071
+
1072
+ </ul>
1073
+
1074
+ </div><table class="source_code">
1075
+ <tr>
1076
+ <td>
1077
+ <pre class="lines">
1078
+
1079
+
1080
+ 111
1081
+ 112
1082
+ 113
1083
+ 114
1084
+ 115
1085
+ 116
1086
+ 117
1087
+ 118
1088
+ 119
1089
+ 120
1090
+ 121
1091
+ 122
1092
+ 123
1093
+ 124
1094
+ 125
1095
+ 126
1096
+ 127
1097
+ 128
1098
+ 129
1099
+ 130
1100
+ 131
1101
+ 132
1102
+ 133
1103
+ 134
1104
+ 135
1105
+ 136
1106
+ 137
1107
+ 138
1108
+ 139
1109
+ 140
1110
+ 141
1111
+ 142
1112
+ 143
1113
+ 144
1114
+ 145
1115
+ 146
1116
+ 147
1117
+ 148
1118
+ 149
1119
+ 150
1120
+ 151
1121
+ 152
1122
+ 153
1123
+ 154
1124
+ 155
1125
+ 156
1126
+ 157
1127
+ 158
1128
+ 159
1129
+ 160
1130
+ 161
1131
+ 162
1132
+ 163
1133
+ 164
1134
+ 165
1135
+ 166
1136
+ 167
1137
+ 168
1138
+ 169
1139
+ 170
1140
+ 171
1141
+ 172
1142
+ 173
1143
+ 174
1144
+ 175
1145
+ 176
1146
+ 177</pre>
1147
+ </td>
1148
+ <td>
1149
+ <pre class="code"><span class="info file"># File 'system_manager.rb', line 111</span>
1150
+
1151
+ <span class='kw'>def</span> <span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_trigger_types'>trigger_types</span><span class='comma'>,</span> <span class='label'>component_or_manager:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
1152
+ <span class='id identifier rubyid_trigger_types'>trigger_types</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='symbol'>:addition_triggers</span><span class='comma'>,</span> <span class='symbol'>:removal_triggers</span><span class='comma'>,</span> <span class='symbol'>:attr_triggers</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_trigger_types'>trigger_types</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
1153
+
1154
+ <span class='kw'>if</span> <span class='id identifier rubyid_trigger_types'>trigger_types</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='symbol'>:attr_triggers</span>
1155
+ <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_trigger_types'>trigger_types</span> <span class='op'>-</span> <span class='lbracket'>[</span><span class='symbol'>:addition_triggers</span><span class='comma'>,</span>
1156
+ <span class='symbol'>:removal_triggers</span><span class='comma'>,</span>
1157
+ <span class='symbol'>:attr_triggers</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
1158
+
1159
+ <span class='kw'>if</span> <span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1160
+ <span class='comment'>#remove all attrs
1161
+ </span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_cmp_or_mgr'>cmp_or_mgr</span><span class='comma'>,</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='op'>|</span>
1162
+ <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>
1163
+ <span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_cmp_or_mgr'>cmp_or_mgr</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1164
+
1165
+ <span class='id identifier rubyid_cmp_or_mgr'>cmp_or_mgr</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='kw'>self</span>
1166
+ <span class='kw'>end</span>
1167
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
1168
+ <span class='kw'>end</span>
1169
+ <span class='kw'>else</span>
1170
+ <span class='comment'>#remove attrs relevant to comp_or_man
1171
+ </span> <span class='kw'>unless</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1172
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_attr'>attr</span><span class='op'>|</span>
1173
+ <span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='kw'>self</span>
1174
+ <span class='kw'>end</span>
1175
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1176
+ <span class='kw'>end</span>
1177
+ <span class='kw'>end</span>
1178
+
1179
+ <span class='kw'>else</span>
1180
+
1181
+ <span class='kw'>if</span> <span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1182
+ <span class='lparen'>(</span><span class='id identifier rubyid_trigger_types'>trigger_types</span> <span class='op'>-</span> <span class='lbracket'>[</span><span class='symbol'>:addition_triggers</span><span class='comma'>,</span> <span class='symbol'>:removal_triggers</span><span class='comma'>,</span> <span class='symbol'>:attr_triggers</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_attr'>attr</span><span class='op'>|</span>
1183
+ <span class='comment'>#remove attr
1184
+ </span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_cmp_or_mgr'>cmp_or_mgr</span><span class='comma'>,</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='op'>|</span>
1185
+ <span class='id identifier rubyid_cmp_or_mgr'>cmp_or_mgr</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='kw'>self</span>
1186
+ <span class='kw'>end</span>
1187
+ <span class='kw'>end</span>
1188
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='lparen'>(</span><span class='id identifier rubyid_trigger_types'>trigger_types</span> <span class='op'>-</span> <span class='lbracket'>[</span><span class='symbol'>:addition_triggers</span><span class='comma'>,</span>
1189
+ <span class='symbol'>:removal_triggers</span><span class='comma'>,</span>
1190
+ <span class='symbol'>:attr_triggers</span><span class='rbracket'>]</span><span class='rparen'>)</span>
1191
+ <span class='kw'>else</span>
1192
+ <span class='comment'>#remove attr from component_or_manager
1193
+ </span> <span class='lparen'>(</span><span class='id identifier rubyid_trigger_types'>trigger_types</span> <span class='op'>-</span> <span class='lbracket'>[</span><span class='symbol'>:addition_triggers</span><span class='comma'>,</span> <span class='symbol'>:removal_triggers</span><span class='comma'>,</span> <span class='symbol'>:attr_triggers</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_attr'>attr</span><span class='op'>|</span>
1194
+ <span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1195
+ <span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='kw'>self</span>
1196
+ <span class='kw'>end</span>
1197
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rbracket'>]</span> <span class='op'>-=</span> <span class='id identifier rubyid_trigger_types'>trigger_types</span> <span class='kw'>unless</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1198
+ <span class='kw'>end</span>
1199
+
1200
+ <span class='kw'>end</span>
1201
+ <span class='kw'>end</span>
1202
+
1203
+ <span class='lparen'>(</span><span class='id identifier rubyid_trigger_types'>trigger_types</span> <span class='op'>&amp;</span> <span class='lbracket'>[</span><span class='symbol'>:removal_triggers</span><span class='comma'>,</span> <span class='symbol'>:addition_triggers</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='lbracket'>[</span><span class='symbol'>:attr_triggers</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_trigger_type'>trigger_type</span><span class='op'>|</span>
1204
+ <span class='kw'>if</span> <span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1205
+ <span class='comment'>#remove all removal triggers
1206
+ </span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_trigger_type'>trigger_type</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_trigger'>trigger</span><span class='op'>|</span>
1207
+ <span class='id identifier rubyid_trigger'>trigger</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_trigger_type'>trigger_type</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='kw'>self</span>
1208
+ <span class='kw'>end</span>
1209
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_trigger_type'>trigger_type</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
1210
+ <span class='kw'>else</span>
1211
+ <span class='comment'>#remove removal trigger relevant to comp/man
1212
+ </span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_trigger_type'>trigger_type</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_component_or_manager'>component_or_manager</span>
1213
+ <span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_trigger_type'>trigger_type</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='kw'>self</span>
1214
+ <span class='kw'>end</span>
1215
+ <span class='kw'>end</span>
1216
+ <span class='kw'>true</span>
1217
+ <span class='kw'>end</span></pre>
1218
+ </td>
1219
+ </tr>
1220
+ </table>
1221
+ </div>
1222
+
1223
+ <div class="method_details ">
1224
+ <h3 class="signature " id="redefine-instance_method">
1225
+
1226
+ #<strong>redefine</strong>(&amp;block) &#x21d2; <tt>Object</tt>
1227
+
1228
+
1229
+
1230
+
1231
+
1232
+ </h3><div class="docstring">
1233
+ <div class="discussion">
1234
+
1235
+ <p>Redefine what code is executed by this System when it is called upon.</p>
1236
+
1237
+
1238
+ </div>
1239
+ </div>
1240
+ <div class="tags">
1241
+ <p class="tag_title">Parameters:</p>
1242
+ <ul class="param">
1243
+
1244
+ <li>
1245
+
1246
+ <span class='name'>block</span>
1247
+
1248
+
1249
+ <span class='type'>(<tt>Proc</tt>)</span>
1250
+
1251
+
1252
+
1253
+ &mdash;
1254
+ <div class='inline'>
1255
+ <p>The code you wish to be executed when the system is triggered. Can be defined by using a <tt>do end</tt> block or using <tt>{ }</tt> braces.</p>
1256
+ </div>
1257
+
1258
+ </li>
1259
+
1260
+ </ul>
1261
+
1262
+
1263
+ </div><table class="source_code">
1264
+ <tr>
1265
+ <td>
1266
+ <pre class="lines">
1267
+
1268
+
1269
+ 84
1270
+ 85
1271
+ 86</pre>
1272
+ </td>
1273
+ <td>
1274
+ <pre class="code"><span class="info file"># File 'system_manager.rb', line 84</span>
1275
+
1276
+ <span class='kw'>def</span> <span class='id identifier rubyid_redefine'>redefine</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
1277
+ <span class='ivar'>@block</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
1278
+ <span class='kw'>end</span></pre>
1279
+ </td>
1280
+ </tr>
1281
+ </table>
1282
+ </div>
1283
+
1284
+ <div class="method_details ">
1285
+ <h3 class="signature " id="trigger_when_added-instance_method">
1286
+
1287
+ #<strong>trigger_when_added</strong>(component_or_manager) &#x21d2; <tt>Boolean</tt>
1288
+
1289
+
1290
+
1291
+
1292
+
1293
+ </h3><div class="docstring">
1294
+ <div class="discussion">
1295
+
1296
+ <p>Add a component or component manager so that it triggers this system when the component or a component from the component manager is added to an entity</p>
1297
+
1298
+
1299
+ </div>
1300
+ </div>
1301
+ <div class="tags">
1302
+ <p class="tag_title">Parameters:</p>
1303
+ <ul class="param">
1304
+
1305
+ <li>
1306
+
1307
+ <span class='name'>component_or_manager</span>
1308
+
1309
+
1310
+ <span class='type'>(<tt>Component or <span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span></tt>)</span>
1311
+
1312
+
1313
+
1314
+ &mdash;
1315
+ <div class='inline'>
1316
+ <p>The component or component manager to trigger this system when added</p>
1317
+ </div>
1318
+
1319
+ </li>
1320
+
1321
+ </ul>
1322
+
1323
+ <p class="tag_title">Returns:</p>
1324
+ <ul class="return">
1325
+
1326
+ <li>
1327
+
1328
+
1329
+ <span class='type'>(<tt>Boolean</tt>)</span>
1330
+
1331
+
1332
+
1333
+ &mdash;
1334
+ <div class='inline'>
1335
+ <p><code>true</code></p>
1336
+ </div>
1337
+
1338
+ </li>
1339
+
1340
+ </ul>
1341
+
1342
+ </div><table class="source_code">
1343
+ <tr>
1344
+ <td>
1345
+ <pre class="lines">
1346
+
1347
+
1348
+ 182
1349
+ 183
1350
+ 184
1351
+ 185
1352
+ 186</pre>
1353
+ </td>
1354
+ <td>
1355
+ <pre class="code"><span class="info file"># File 'system_manager.rb', line 182</span>
1356
+
1357
+ <span class='kw'>def</span> <span class='id identifier rubyid_trigger_when_added'>trigger_when_added</span><span class='lparen'>(</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rparen'>)</span>
1358
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_addition_triggers'>addition_triggers</span> <span class='op'>|=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rbracket'>]</span>
1359
+ <span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='period'>.</span><span class='id identifier rubyid_addition_triggers'>addition_triggers</span> <span class='op'>|=</span> <span class='lbracket'>[</span><span class='kw'>self</span><span class='rbracket'>]</span>
1360
+ <span class='kw'>true</span>
1361
+ <span class='kw'>end</span></pre>
1362
+ </td>
1363
+ </tr>
1364
+ </table>
1365
+ </div>
1366
+
1367
+ <div class="method_details ">
1368
+ <h3 class="signature " id="trigger_when_is_changed-instance_method">
1369
+
1370
+ #<strong>trigger_when_is_changed</strong>(component_or_manager, attr) &#x21d2; <tt>Boolean</tt>
1371
+
1372
+
1373
+
1374
+
1375
+
1376
+ </h3><div class="docstring">
1377
+ <div class="discussion">
1378
+
1379
+ <p>Add a component or component manager so that it triggers this system when a component&#39;s attribute is changed.</p>
1380
+
1381
+
1382
+ </div>
1383
+ </div>
1384
+ <div class="tags">
1385
+
1386
+ <p class="tag_title">Returns:</p>
1387
+ <ul class="return">
1388
+
1389
+ <li>
1390
+
1391
+
1392
+ <span class='type'>(<tt>Boolean</tt>)</span>
1393
+
1394
+
1395
+
1396
+ &mdash;
1397
+ <div class='inline'>
1398
+ <p><code>true</code></p>
1399
+ </div>
1400
+
1401
+ </li>
1402
+
1403
+ </ul>
1404
+
1405
+ </div><table class="source_code">
1406
+ <tr>
1407
+ <td>
1408
+ <pre class="lines">
1409
+
1410
+
1411
+ 199
1412
+ 200
1413
+ 201
1414
+ 202
1415
+ 203
1416
+ 204
1417
+ 205
1418
+ 206
1419
+ 207
1420
+ 208
1421
+ 209
1422
+ 210
1423
+ 211</pre>
1424
+ </td>
1425
+ <td>
1426
+ <pre class="code"><span class="info file"># File 'system_manager.rb', line 199</span>
1427
+
1428
+ <span class='kw'>def</span> <span class='id identifier rubyid_trigger_when_is_changed'>trigger_when_is_changed</span><span class='lparen'>(</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='comma'>,</span> <span class='id identifier rubyid_attr'>attr</span><span class='rparen'>)</span>
1429
+ <span class='kw'>if</span> <span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1430
+ <span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='kw'>self</span><span class='rbracket'>]</span>
1431
+ <span class='kw'>else</span>
1432
+ <span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span> <span class='op'>|=</span> <span class='lbracket'>[</span><span class='kw'>self</span><span class='rbracket'>]</span>
1433
+ <span class='kw'>end</span>
1434
+ <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1435
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span>
1436
+ <span class='kw'>else</span>
1437
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rbracket'>]</span> <span class='op'>|=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span>
1438
+ <span class='kw'>end</span>
1439
+ <span class='kw'>true</span>
1440
+ <span class='kw'>end</span></pre>
1441
+ </td>
1442
+ </tr>
1443
+ </table>
1444
+ </div>
1445
+
1446
+ <div class="method_details ">
1447
+ <h3 class="signature " id="trigger_when_removed-instance_method">
1448
+
1449
+ #<strong>trigger_when_removed</strong>(component_or_manager) &#x21d2; <tt>Boolean</tt>
1450
+
1451
+
1452
+
1453
+
1454
+
1455
+ </h3><div class="docstring">
1456
+ <div class="discussion">
1457
+
1458
+ <p>Add a component or component manager so that it triggers this system when the component or a component from the component manager is removed from an entity</p>
1459
+
1460
+
1461
+ </div>
1462
+ </div>
1463
+ <div class="tags">
1464
+ <p class="tag_title">Parameters:</p>
1465
+ <ul class="param">
1466
+
1467
+ <li>
1468
+
1469
+ <span class='name'>component_or_manager</span>
1470
+
1471
+
1472
+ <span class='type'>(<tt>Component or <span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span></tt>)</span>
1473
+
1474
+
1475
+
1476
+ &mdash;
1477
+ <div class='inline'>
1478
+ <p>The component or component manager to trigger this system when removed</p>
1479
+ </div>
1480
+
1481
+ </li>
1482
+
1483
+ </ul>
1484
+
1485
+ <p class="tag_title">Returns:</p>
1486
+ <ul class="return">
1487
+
1488
+ <li>
1489
+
1490
+
1491
+ <span class='type'>(<tt>Boolean</tt>)</span>
1492
+
1493
+
1494
+
1495
+ &mdash;
1496
+ <div class='inline'>
1497
+ <p><code>true</code></p>
1498
+ </div>
1499
+
1500
+ </li>
1501
+
1502
+ </ul>
1503
+
1504
+ </div><table class="source_code">
1505
+ <tr>
1506
+ <td>
1507
+ <pre class="lines">
1508
+
1509
+
1510
+ 191
1511
+ 192
1512
+ 193
1513
+ 194
1514
+ 195</pre>
1515
+ </td>
1516
+ <td>
1517
+ <pre class="code"><span class="info file"># File 'system_manager.rb', line 191</span>
1518
+
1519
+ <span class='kw'>def</span> <span class='id identifier rubyid_trigger_when_removed'>trigger_when_removed</span><span class='lparen'>(</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rparen'>)</span>
1520
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_removal_triggers'>removal_triggers</span> <span class='op'>|=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='rbracket'>]</span>
1521
+ <span class='id identifier rubyid_component_or_manager'>component_or_manager</span><span class='period'>.</span><span class='id identifier rubyid_removal_triggers'>removal_triggers</span> <span class='op'>|=</span> <span class='lbracket'>[</span><span class='kw'>self</span><span class='rbracket'>]</span>
1522
+ <span class='kw'>true</span>
1523
+ <span class='kw'>end</span></pre>
1524
+ </td>
1525
+ </tr>
1526
+ </table>
1527
+ </div>
1528
+
1529
+ </div>
1530
+
1531
+ </div>
1532
+
1533
+ <div id="footer">
1534
+ Generated on Fri Jul 9 01:56:54 2021 by
1535
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1536
+ 0.9.26 (ruby-2.7.3).
1537
+ </div>
1538
+
1539
+ </div>
1540
+ </body>
1541
+ </html>