felecs 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) 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/.ruby-version +1 -0
  8. data/CHANGELOG.mdown +80 -0
  9. data/Gemfile +10 -0
  10. data/Gemfile.lock +87 -0
  11. data/LICENSE +21 -0
  12. data/README.mdown +465 -0
  13. data/Rakefile +66 -0
  14. data/bin/console +15 -0
  15. data/bin/setup +8 -0
  16. data/docs/CNAME +1 -0
  17. data/docs/FelECS/ComponentManager.html +1239 -0
  18. data/docs/FelECS/Components.html +337 -0
  19. data/docs/FelECS/Entities.html +792 -0
  20. data/docs/FelECS/Order.html +251 -0
  21. data/docs/FelECS/Scenes.html +765 -0
  22. data/docs/FelECS/Stage.html +572 -0
  23. data/docs/FelECS/Systems.html +1505 -0
  24. data/docs/FelECS.html +335 -0
  25. data/docs/FelFlame/ComponentManager.html +1239 -0
  26. data/docs/FelFlame/Components.html +333 -0
  27. data/docs/FelFlame/Entities.html +792 -0
  28. data/docs/FelFlame/Helper/ComponentManager.html +1627 -0
  29. data/docs/FelFlame/Helper.html +142 -0
  30. data/docs/FelFlame/Order.html +251 -0
  31. data/docs/FelFlame/Scenes.html +765 -0
  32. data/docs/FelFlame/Stage.html +572 -0
  33. data/docs/FelFlame/Systems.html +1505 -0
  34. data/docs/FelFlame.html +319 -0
  35. data/docs/Felflame_.html +143 -0
  36. data/docs/_index.html +188 -0
  37. data/docs/class_list.html +51 -0
  38. data/docs/css/common.css +1 -0
  39. data/docs/css/full_list.css +58 -0
  40. data/docs/css/style.css +497 -0
  41. data/docs/file.README.html +560 -0
  42. data/docs/file.version.html +74 -0
  43. data/docs/file_list.html +56 -0
  44. data/docs/frames.html +17 -0
  45. data/docs/index.html +560 -0
  46. data/docs/js/app.js +314 -0
  47. data/docs/js/full_list.js +216 -0
  48. data/docs/js/jquery.js +4 -0
  49. data/docs/method_list.html +419 -0
  50. data/docs/top-level-namespace.html +137 -0
  51. data/felecs.gemspec +45 -0
  52. data/lib/felecs/component_manager.rb +279 -0
  53. data/lib/felecs/entity_manager.rb +160 -0
  54. data/lib/felecs/order.rb +24 -0
  55. data/lib/felecs/scene_manager.rb +69 -0
  56. data/lib/felecs/stage_manager.rb +47 -0
  57. data/lib/felecs/system_manager.rb +258 -0
  58. data/lib/felecs/version.rb +9 -0
  59. data/lib/felecs.rb +67 -0
  60. data/mrbgem/mrbgem.rake +4 -0
  61. data/mrbgem/mrblib/felecs.rb +913 -0
  62. metadata +229 -0
@@ -0,0 +1,1239 @@
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: FelECS::ComponentManager
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 = "FelECS::ComponentManager";
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="../FelECS.html" title="FelECS (module)">FelECS</a></span></span>
41
+ &raquo;
42
+ <span class="title">ComponentManager</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: FelECS::ComponentManager
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">FelECS::ComponentManager</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/felecs/component_manager.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Component Managers are what is used to create individual components which can be attached to entities. When a Component is created from a Component Manager that has accessors given to it, you can set or get the values of those accessors using standard ruby message sending (e.g <tt>@component.var = 5</tt>), or by using the <span class='object_link'><a href="#to_h-instance_method" title="FelECS::ComponentManager#to_h (method)">#to_h</a></span> and <span class='object_link'><a href="#update_attrs-instance_method" title="FelECS::ComponentManager#update_attrs (method)">#update_attrs</a></span> methods instead.</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div>
114
+
115
+
116
+
117
+ <h2>Class Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
118
+ <ul class="summary">
119
+
120
+ <li class="public ">
121
+ <span class="summary_signature">
122
+
123
+ <a href="#addition_triggers-class_method" title="addition_triggers (class method)">.<strong>addition_triggers</strong> &#x21d2; Array&lt;System&gt; </a>
124
+
125
+
126
+
127
+ </span>
128
+
129
+
130
+
131
+
132
+ <span class="note title readonly">readonly</span>
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+ <span class="summary_desc"><div class='inline'>
143
+ <p>Stores references to systems that should be triggered when this component is added to an enitity.</p>
144
+ </div></span>
145
+
146
+ </li>
147
+
148
+
149
+ <li class="public ">
150
+ <span class="summary_signature">
151
+
152
+ <a href="#attr_triggers-class_method" title="attr_triggers (class method)">.<strong>attr_triggers</strong> &#x21d2; Hash&lt;Symbol, System&gt; </a>
153
+
154
+
155
+
156
+ </span>
157
+
158
+
159
+
160
+
161
+ <span class="note title readonly">readonly</span>
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ <span class="summary_desc"><div class='inline'>
172
+ <p>Stores references to systems that should be triggered when an attribute from this component changed.</p>
173
+ </div></span>
174
+
175
+ </li>
176
+
177
+
178
+ <li class="public ">
179
+ <span class="summary_signature">
180
+
181
+ <a href="#removal_triggers-class_method" title="removal_triggers (class method)">.<strong>removal_triggers</strong> &#x21d2; Array&lt;System&gt; </a>
182
+
183
+
184
+
185
+ </span>
186
+
187
+
188
+
189
+
190
+ <span class="note title readonly">readonly</span>
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+ <span class="summary_desc"><div class='inline'>
201
+ <p>Stores references to systems that should be triggered when this component is removed from an enitity.</p>
202
+ </div></span>
203
+
204
+ </li>
205
+
206
+
207
+ </ul>
208
+
209
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
210
+ <ul class="summary">
211
+
212
+ <li class="public ">
213
+ <span class="summary_signature">
214
+
215
+ <a href="#addition_triggers-instance_method" title="#addition_triggers (instance method)">#<strong>addition_triggers</strong> &#x21d2; Array&lt;System&gt; </a>
216
+
217
+
218
+
219
+ </span>
220
+
221
+
222
+
223
+
224
+ <span class="note title readonly">readonly</span>
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+ <span class="summary_desc"><div class='inline'>
235
+ <p>Stores references to systems that should be triggered when a component from this manager is added.</p>
236
+ </div></span>
237
+
238
+ </li>
239
+
240
+
241
+ <li class="public ">
242
+ <span class="summary_signature">
243
+
244
+ <a href="#attr_triggers-instance_method" title="#attr_triggers (instance method)">#<strong>attr_triggers</strong> &#x21d2; Hash&lt;Symbol, Array&lt;System&gt;&gt; </a>
245
+
246
+
247
+
248
+ </span>
249
+
250
+
251
+
252
+
253
+ <span class="note title readonly">readonly</span>
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+ <span class="summary_desc"><div class='inline'>
264
+ <p>Stores references to systems that should be triggered when an attribute from this manager is changed.</p>
265
+ </div></span>
266
+
267
+ </li>
268
+
269
+
270
+ <li class="public ">
271
+ <span class="summary_signature">
272
+
273
+ <a href="#removal_triggers-instance_method" title="#removal_triggers (instance method)">#<strong>removal_triggers</strong> &#x21d2; Array&lt;System&gt; </a>
274
+
275
+
276
+
277
+ </span>
278
+
279
+
280
+
281
+
282
+ <span class="note title readonly">readonly</span>
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+ <span class="summary_desc"><div class='inline'>
293
+ <p>Stores references to systems that should be triggered when a component from this manager is removed.</p>
294
+ </div></span>
295
+
296
+ </li>
297
+
298
+
299
+ </ul>
300
+
301
+
302
+
303
+
304
+
305
+ <h2>
306
+ Instance Method Summary
307
+ <small><a href="#" class="summary_toggle">collapse</a></small>
308
+ </h2>
309
+
310
+ <ul class="summary">
311
+
312
+ <li class="public ">
313
+ <span class="summary_signature">
314
+
315
+ <a href="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong> &#x21d2; Boolean </a>
316
+
317
+
318
+
319
+ </span>
320
+
321
+
322
+
323
+
324
+
325
+
326
+
327
+
328
+
329
+ <span class="summary_desc"><div class='inline'>
330
+ <p>Removes this component from the list and purges all references to this Component from other Entities, as well as its data.</p>
331
+ </div></span>
332
+
333
+ </li>
334
+
335
+
336
+ <li class="public ">
337
+ <span class="summary_signature">
338
+
339
+ <a href="#entities-instance_method" title="#entities (instance method)">#<strong>entities</strong> &#x21d2; Array&lt;Component&gt; </a>
340
+
341
+
342
+
343
+ </span>
344
+
345
+
346
+
347
+
348
+
349
+
350
+
351
+
352
+
353
+ <span class="summary_desc"><div class='inline'>
354
+ <p>Entities that have this component.</p>
355
+ </div></span>
356
+
357
+ </li>
358
+
359
+
360
+ <li class="public ">
361
+ <span class="summary_signature">
362
+
363
+ <a href="#entity-instance_method" title="#entity (instance method)">#<strong>entity</strong> &#x21d2; Component </a>
364
+
365
+
366
+
367
+ </span>
368
+
369
+
370
+
371
+
372
+
373
+
374
+
375
+
376
+
377
+ <span class="summary_desc"><div class='inline'>
378
+ <p>A single entity.</p>
379
+ </div></span>
380
+
381
+ </li>
382
+
383
+
384
+ <li class="public ">
385
+ <span class="summary_signature">
386
+
387
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(**attrs) &#x21d2; Component </a>
388
+
389
+
390
+
391
+ </span>
392
+
393
+
394
+ <span class="note title constructor">constructor</span>
395
+
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+ <span class="summary_desc"><div class='inline'>
404
+ <p>Creates a new component and sets the values of the attributes given to it.</p>
405
+ </div></span>
406
+
407
+ </li>
408
+
409
+
410
+ <li class="public ">
411
+ <span class="summary_signature">
412
+
413
+ <a href="#to_h-instance_method" title="#to_h (instance method)">#<strong>to_h</strong> &#x21d2; Hash&lt;Symbol, Value&gt; </a>
414
+
415
+
416
+
417
+ </span>
418
+
419
+
420
+
421
+
422
+
423
+
424
+
425
+
426
+
427
+ <span class="summary_desc"><div class='inline'>
428
+ <p>A hash, where all the keys are attributes storing their respective values.</p>
429
+ </div></span>
430
+
431
+ </li>
432
+
433
+
434
+ <li class="public ">
435
+ <span class="summary_signature">
436
+
437
+ <a href="#update_attrs-instance_method" title="#update_attrs (instance method)">#<strong>update_attrs</strong>(**opts) &#x21d2; Hash&lt;Symbol, Value&gt; </a>
438
+
439
+
440
+
441
+ </span>
442
+
443
+
444
+
445
+
446
+
447
+
448
+
449
+
450
+
451
+ <span class="summary_desc"><div class='inline'>
452
+ <p>Update attribute values using a hash or keywords.</p>
453
+ </div></span>
454
+
455
+ </li>
456
+
457
+
458
+ </ul>
459
+
460
+
461
+ <div id="constructor_details" class="method_details_list">
462
+ <h2>Constructor Details</h2>
463
+
464
+ <div class="method_details first">
465
+ <h3 class="signature first" id="initialize-instance_method">
466
+
467
+ #<strong>initialize</strong>(**attrs) &#x21d2; <tt>Component</tt>
468
+
469
+
470
+
471
+
472
+
473
+ </h3><div class="docstring">
474
+ <div class="discussion">
475
+
476
+ <p>Creates a new component and sets the values of the attributes given to it. If an attritbute is not passed then it will remain as the default.</p>
477
+
478
+
479
+ </div>
480
+ </div>
481
+ <div class="tags">
482
+ <p class="tag_title">Parameters:</p>
483
+ <ul class="param">
484
+
485
+ <li>
486
+
487
+ <span class='name'>attrs</span>
488
+
489
+
490
+ <span class='type'>(<tt>Keyword: Value</tt>)</span>
491
+
492
+
493
+
494
+ &mdash;
495
+ <div class='inline'>
496
+ <p>You can pass any number of Keyword-Value pairs</p>
497
+ </div>
498
+
499
+ </li>
500
+
501
+ </ul>
502
+
503
+
504
+ </div><table class="source_code">
505
+ <tr>
506
+ <td>
507
+ <pre class="lines">
508
+
509
+
510
+ 134
511
+ 135
512
+ 136
513
+ 137
514
+ 138
515
+ 139
516
+ 140
517
+ 141
518
+ 142
519
+ 143
520
+ 144
521
+ 145
522
+ 146
523
+ 147</pre>
524
+ </td>
525
+ <td>
526
+ <pre class="code"><span class="info file"># File 'lib/felecs/component_manager.rb', line 134</span>
527
+
528
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span>
529
+ <span class='comment'># Prepare the object
530
+ </span> <span class='comment'># (this is a function created with metaprogramming
531
+ </span> <span class='comment'># in FelECS::Components)
532
+ </span> <span class='id identifier rubyid_set_defaults'>set_defaults</span>
533
+
534
+ <span class='comment'># Fill params
535
+ </span> <span class='id identifier rubyid_attrs'>attrs</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
536
+ <span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span>
537
+ <span class='kw'>end</span>
538
+
539
+ <span class='comment'># Save Component
540
+ </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_push'>push</span> <span class='kw'>self</span>
541
+ <span class='kw'>end</span></pre>
542
+ </td>
543
+ </tr>
544
+ </table>
545
+ </div>
546
+
547
+ </div>
548
+
549
+ <div id="class_attr_details" class="attr_details">
550
+ <h2>Class Attribute Details</h2>
551
+
552
+
553
+ <span id="addition_triggers=-class_method"></span>
554
+ <div class="method_details first">
555
+ <h3 class="signature first" id="addition_triggers-class_method">
556
+
557
+ .<strong>addition_triggers</strong> &#x21d2; <tt>Array&lt;System&gt;</tt>
558
+
559
+
560
+
561
+
562
+
563
+ </h3><div class="docstring">
564
+ <div class="discussion">
565
+
566
+ <p>Stores references to systems that should be triggered when this component is added to an enitity. Do not edit this array as it is managed by FelECS automatically.</p>
567
+
568
+
569
+ </div>
570
+ </div>
571
+ <div class="tags">
572
+
573
+ <p class="tag_title">Returns:</p>
574
+ <ul class="return">
575
+
576
+ <li>
577
+
578
+
579
+ <span class='type'>(<tt>Array&lt;System&gt;</tt>)</span>
580
+
581
+
582
+
583
+ </li>
584
+
585
+ </ul>
586
+
587
+ </div><table class="source_code">
588
+ <tr>
589
+ <td>
590
+ <pre class="lines">
591
+
592
+
593
+ 182
594
+ 183
595
+ 184</pre>
596
+ </td>
597
+ <td>
598
+ <pre class="code"><span class="info file"># File 'lib/felecs/component_manager.rb', line 182</span>
599
+
600
+ <span class='kw'>def</span> <span class='id identifier rubyid_addition_triggers'>addition_triggers</span>
601
+ <span class='ivar'>@addition_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
602
+ <span class='kw'>end</span></pre>
603
+ </td>
604
+ </tr>
605
+ </table>
606
+ </div>
607
+
608
+
609
+ <span id="attr_triggers=-class_method"></span>
610
+ <div class="method_details ">
611
+ <h3 class="signature " id="attr_triggers-class_method">
612
+
613
+ .<strong>attr_triggers</strong> &#x21d2; <tt>Hash&lt;Symbol, System&gt;</tt>
614
+
615
+
616
+
617
+
618
+
619
+ </h3><div class="docstring">
620
+ <div class="discussion">
621
+
622
+ <p>Stores references to systems that should be triggered when an attribute from this component changed. Do not edit this hash as it is managed by FelECS automatically.</p>
623
+
624
+
625
+ </div>
626
+ </div>
627
+ <div class="tags">
628
+
629
+ <p class="tag_title">Returns:</p>
630
+ <ul class="return">
631
+
632
+ <li>
633
+
634
+
635
+ <span class='type'>(<tt>Hash&lt;Symbol, System&gt;</tt>)</span>
636
+
637
+
638
+
639
+ </li>
640
+
641
+ </ul>
642
+
643
+ </div><table class="source_code">
644
+ <tr>
645
+ <td>
646
+ <pre class="lines">
647
+
648
+
649
+ 198
650
+ 199
651
+ 200</pre>
652
+ </td>
653
+ <td>
654
+ <pre class="code"><span class="info file"># File 'lib/felecs/component_manager.rb', line 198</span>
655
+
656
+ <span class='kw'>def</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span>
657
+ <span class='ivar'>@attr_triggers</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
658
+ <span class='kw'>end</span></pre>
659
+ </td>
660
+ </tr>
661
+ </table>
662
+ </div>
663
+
664
+
665
+ <span id="removal_triggers=-class_method"></span>
666
+ <div class="method_details ">
667
+ <h3 class="signature " id="removal_triggers-class_method">
668
+
669
+ .<strong>removal_triggers</strong> &#x21d2; <tt>Array&lt;System&gt;</tt>
670
+
671
+
672
+
673
+
674
+
675
+ </h3><div class="docstring">
676
+ <div class="discussion">
677
+
678
+ <p>Stores references to systems that should be triggered when this component is removed from an enitity. Do not edit this array as it is managed by FelECS automatically.</p>
679
+
680
+
681
+ </div>
682
+ </div>
683
+ <div class="tags">
684
+
685
+ <p class="tag_title">Returns:</p>
686
+ <ul class="return">
687
+
688
+ <li>
689
+
690
+
691
+ <span class='type'>(<tt>Array&lt;System&gt;</tt>)</span>
692
+
693
+
694
+
695
+ </li>
696
+
697
+ </ul>
698
+
699
+ </div><table class="source_code">
700
+ <tr>
701
+ <td>
702
+ <pre class="lines">
703
+
704
+
705
+ 190
706
+ 191
707
+ 192</pre>
708
+ </td>
709
+ <td>
710
+ <pre class="code"><span class="info file"># File 'lib/felecs/component_manager.rb', line 190</span>
711
+
712
+ <span class='kw'>def</span> <span class='id identifier rubyid_removal_triggers'>removal_triggers</span>
713
+ <span class='ivar'>@removal_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
714
+ <span class='kw'>end</span></pre>
715
+ </td>
716
+ </tr>
717
+ </table>
718
+ </div>
719
+
720
+ </div>
721
+
722
+ <div id="instance_attr_details" class="attr_details">
723
+ <h2>Instance Attribute Details</h2>
724
+
725
+
726
+ <span id="addition_triggers=-instance_method"></span>
727
+ <div class="method_details first">
728
+ <h3 class="signature first" id="addition_triggers-instance_method">
729
+
730
+ #<strong>addition_triggers</strong> &#x21d2; <tt>Array&lt;System&gt;</tt>
731
+
732
+
733
+
734
+
735
+
736
+ </h3><div class="docstring">
737
+ <div class="discussion">
738
+
739
+ <p>Stores references to systems that should be triggered when a component from this manager is added. Do not edit this array as it is managed by FelECS automatically.</p>
740
+
741
+
742
+ </div>
743
+ </div>
744
+ <div class="tags">
745
+
746
+ <p class="tag_title">Returns:</p>
747
+ <ul class="return">
748
+
749
+ <li>
750
+
751
+
752
+ <span class='type'>(<tt>Array&lt;System&gt;</tt>)</span>
753
+
754
+
755
+
756
+ </li>
757
+
758
+ </ul>
759
+
760
+ </div><table class="source_code">
761
+ <tr>
762
+ <td>
763
+ <pre class="lines">
764
+
765
+
766
+ 111
767
+ 112
768
+ 113</pre>
769
+ </td>
770
+ <td>
771
+ <pre class="code"><span class="info file"># File 'lib/felecs/component_manager.rb', line 111</span>
772
+
773
+ <span class='kw'>def</span> <span class='id identifier rubyid_addition_triggers'>addition_triggers</span>
774
+ <span class='ivar'>@addition_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
775
+ <span class='kw'>end</span></pre>
776
+ </td>
777
+ </tr>
778
+ </table>
779
+ </div>
780
+
781
+
782
+ <span id="attr_triggers=-instance_method"></span>
783
+ <div class="method_details ">
784
+ <h3 class="signature " id="attr_triggers-instance_method">
785
+
786
+ #<strong>attr_triggers</strong> &#x21d2; <tt>Hash&lt;Symbol, Array&lt;System&gt;&gt;</tt>
787
+
788
+
789
+
790
+
791
+
792
+ </h3><div class="docstring">
793
+ <div class="discussion">
794
+
795
+ <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 FelECS automatically.</p>
796
+
797
+
798
+ </div>
799
+ </div>
800
+ <div class="tags">
801
+
802
+ <p class="tag_title">Returns:</p>
803
+ <ul class="return">
804
+
805
+ <li>
806
+
807
+
808
+ <span class='type'>(<tt>Hash&lt;Symbol, Array&lt;System&gt;&gt;</tt>)</span>
809
+
810
+
811
+
812
+ </li>
813
+
814
+ </ul>
815
+
816
+ </div><table class="source_code">
817
+ <tr>
818
+ <td>
819
+ <pre class="lines">
820
+
821
+
822
+ 127
823
+ 128
824
+ 129</pre>
825
+ </td>
826
+ <td>
827
+ <pre class="code"><span class="info file"># File 'lib/felecs/component_manager.rb', line 127</span>
828
+
829
+ <span class='kw'>def</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span>
830
+ <span class='ivar'>@attr_triggers</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
831
+ <span class='kw'>end</span></pre>
832
+ </td>
833
+ </tr>
834
+ </table>
835
+ </div>
836
+
837
+
838
+ <span id="removal_triggers=-instance_method"></span>
839
+ <div class="method_details ">
840
+ <h3 class="signature " id="removal_triggers-instance_method">
841
+
842
+ #<strong>removal_triggers</strong> &#x21d2; <tt>Array&lt;System&gt;</tt>
843
+
844
+
845
+
846
+
847
+
848
+ </h3><div class="docstring">
849
+ <div class="discussion">
850
+
851
+ <p>Stores references to systems that should be triggered when a component from this manager is removed. Do not edit this array as it is managed by FelECS automatically.</p>
852
+
853
+
854
+ </div>
855
+ </div>
856
+ <div class="tags">
857
+
858
+ <p class="tag_title">Returns:</p>
859
+ <ul class="return">
860
+
861
+ <li>
862
+
863
+
864
+ <span class='type'>(<tt>Array&lt;System&gt;</tt>)</span>
865
+
866
+
867
+
868
+ </li>
869
+
870
+ </ul>
871
+
872
+ </div><table class="source_code">
873
+ <tr>
874
+ <td>
875
+ <pre class="lines">
876
+
877
+
878
+ 119
879
+ 120
880
+ 121</pre>
881
+ </td>
882
+ <td>
883
+ <pre class="code"><span class="info file"># File 'lib/felecs/component_manager.rb', line 119</span>
884
+
885
+ <span class='kw'>def</span> <span class='id identifier rubyid_removal_triggers'>removal_triggers</span>
886
+ <span class='ivar'>@removal_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
887
+ <span class='kw'>end</span></pre>
888
+ </td>
889
+ </tr>
890
+ </table>
891
+ </div>
892
+
893
+ </div>
894
+
895
+
896
+ <div id="instance_method_details" class="method_details_list">
897
+ <h2>Instance Method Details</h2>
898
+
899
+
900
+ <div class="method_details first">
901
+ <h3 class="signature first" id="delete-instance_method">
902
+
903
+ #<strong>delete</strong> &#x21d2; <tt>Boolean</tt>
904
+
905
+
906
+
907
+
908
+
909
+ </h3><div class="docstring">
910
+ <div class="discussion">
911
+
912
+ <p>Removes this component from the list and purges all references to this Component from other Entities, as well as its data.</p>
913
+
914
+
915
+ </div>
916
+ </div>
917
+ <div class="tags">
918
+
919
+ <p class="tag_title">Returns:</p>
920
+ <ul class="return">
921
+
922
+ <li>
923
+
924
+
925
+ <span class='type'>(<tt>Boolean</tt>)</span>
926
+
927
+
928
+
929
+ &mdash;
930
+ <div class='inline'>
931
+ <p><code>true</code>.</p>
932
+ </div>
933
+
934
+ </li>
935
+
936
+ </ul>
937
+
938
+ </div><table class="source_code">
939
+ <tr>
940
+ <td>
941
+ <pre class="lines">
942
+
943
+
944
+ 249
945
+ 250
946
+ 251
947
+ 252
948
+ 253
949
+ 254
950
+ 255
951
+ 256
952
+ 257
953
+ 258
954
+ 259
955
+ 260
956
+ 261</pre>
957
+ </td>
958
+ <td>
959
+ <pre class="code"><span class="info file"># File 'lib/felecs/component_manager.rb', line 249</span>
960
+
961
+ <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
962
+ <span class='id identifier rubyid_addition_triggers'>addition_triggers</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_system'>system</span><span class='op'>|</span>
963
+ <span class='id identifier rubyid_system'>system</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span> <span class='label'>component_or_manager:</span> <span class='kw'>self</span>
964
+ <span class='kw'>end</span>
965
+ <span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_reverse_each'>reverse_each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_entity'>entity</span><span class='op'>|</span>
966
+ <span class='id identifier rubyid_entity'>entity</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span> <span class='kw'>self</span>
967
+ <span class='kw'>end</span>
968
+ <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_delete'>delete</span> <span class='kw'>self</span>
969
+ <span class='id identifier rubyid_instance_variables'>instance_variables</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_var'>var</span><span class='op'>|</span>
970
+ <span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='id identifier rubyid_var'>var</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
971
+ <span class='kw'>end</span>
972
+ <span class='kw'>true</span>
973
+ <span class='kw'>end</span></pre>
974
+ </td>
975
+ </tr>
976
+ </table>
977
+ </div>
978
+
979
+ <div class="method_details ">
980
+ <h3 class="signature " id="entities-instance_method">
981
+
982
+ #<strong>entities</strong> &#x21d2; <tt>Array&lt;Component&gt;</tt>
983
+
984
+
985
+
986
+
987
+
988
+ </h3><div class="docstring">
989
+ <div class="discussion">
990
+
991
+ <p>Entities that have this component</p>
992
+
993
+
994
+ </div>
995
+ </div>
996
+ <div class="tags">
997
+
998
+ <p class="tag_title">Returns:</p>
999
+ <ul class="return">
1000
+
1001
+ <li>
1002
+
1003
+
1004
+ <span class='type'>(<tt>Array&lt;Component&gt;</tt>)</span>
1005
+
1006
+
1007
+
1008
+ </li>
1009
+
1010
+ </ul>
1011
+
1012
+ </div><table class="source_code">
1013
+ <tr>
1014
+ <td>
1015
+ <pre class="lines">
1016
+
1017
+
1018
+ 211
1019
+ 212
1020
+ 213</pre>
1021
+ </td>
1022
+ <td>
1023
+ <pre class="code"><span class="info file"># File 'lib/felecs/component_manager.rb', line 211</span>
1024
+
1025
+ <span class='kw'>def</span> <span class='id identifier rubyid_entities'>entities</span>
1026
+ <span class='ivar'>@entities</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1027
+ <span class='kw'>end</span></pre>
1028
+ </td>
1029
+ </tr>
1030
+ </table>
1031
+ </div>
1032
+
1033
+ <div class="method_details ">
1034
+ <h3 class="signature " id="entity-instance_method">
1035
+
1036
+ #<strong>entity</strong> &#x21d2; <tt>Component</tt>
1037
+
1038
+
1039
+
1040
+
1041
+
1042
+ </h3><div class="docstring">
1043
+ <div class="discussion">
1044
+
1045
+ <p>A single entity. Use this if you expect the component to only belong to one entity and you want to access it.</p>
1046
+
1047
+
1048
+ </div>
1049
+ </div>
1050
+ <div class="tags">
1051
+
1052
+ <p class="tag_title">Returns:</p>
1053
+ <ul class="return">
1054
+
1055
+ <li>
1056
+
1057
+
1058
+ <span class='type'>(<tt>Component</tt>)</span>
1059
+
1060
+
1061
+
1062
+ </li>
1063
+
1064
+ </ul>
1065
+
1066
+ </div><table class="source_code">
1067
+ <tr>
1068
+ <td>
1069
+ <pre class="lines">
1070
+
1071
+
1072
+ 217
1073
+ 218
1074
+ 219
1075
+ 220
1076
+ 221
1077
+ 222
1078
+ 223
1079
+ 224</pre>
1080
+ </td>
1081
+ <td>
1082
+ <pre class="code"><span class="info file"># File 'lib/felecs/component_manager.rb', line 217</span>
1083
+
1084
+ <span class='kw'>def</span> <span class='id identifier rubyid_entity'>entity</span>
1085
+ <span class='kw'>if</span> <span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
1086
+ <span class='const'>Warning</span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>This component belongs to NO entities but you called the method that is intended for components belonging to a single entity.\nYou may have a bug in your logic.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1087
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>&gt;</span> <span class='int'>1</span>
1088
+ <span class='const'>Warning</span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>This component belongs to MANY entities but you called the method that is intended for components belonging to a single entity.\nYou may have a bug in your logic.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1089
+ <span class='kw'>end</span>
1090
+ <span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
1091
+ <span class='kw'>end</span></pre>
1092
+ </td>
1093
+ </tr>
1094
+ </table>
1095
+ </div>
1096
+
1097
+ <div class="method_details ">
1098
+ <h3 class="signature " id="to_h-instance_method">
1099
+
1100
+ #<strong>to_h</strong> &#x21d2; <tt>Hash&lt;Symbol, Value&gt;</tt>
1101
+
1102
+
1103
+
1104
+
1105
+
1106
+ </h3><div class="docstring">
1107
+ <div class="discussion">
1108
+
1109
+ <p>Returns A hash, where all the keys are attributes storing their respective values.</p>
1110
+
1111
+
1112
+ </div>
1113
+ </div>
1114
+ <div class="tags">
1115
+
1116
+ <p class="tag_title">Returns:</p>
1117
+ <ul class="return">
1118
+
1119
+ <li>
1120
+
1121
+
1122
+ <span class='type'>(<tt>Hash&lt;Symbol, Value&gt;</tt>)</span>
1123
+
1124
+
1125
+
1126
+ &mdash;
1127
+ <div class='inline'>
1128
+ <p>A hash, where all the keys are attributes storing their respective values.</p>
1129
+ </div>
1130
+
1131
+ </li>
1132
+
1133
+ </ul>
1134
+
1135
+ </div><table class="source_code">
1136
+ <tr>
1137
+ <td>
1138
+ <pre class="lines">
1139
+
1140
+
1141
+ 264
1142
+ 265
1143
+ 266
1144
+ 267
1145
+ 268
1146
+ 269
1147
+ 270</pre>
1148
+ </td>
1149
+ <td>
1150
+ <pre class="code"><span class="info file"># File 'lib/felecs/component_manager.rb', line 264</span>
1151
+
1152
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_h'>to_h</span>
1153
+ <span class='id identifier rubyid_return_hash'>return_hash</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_variables'>instance_variables</span><span class='period'>.</span><span class='id identifier rubyid_each_with_object'>each_with_object</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_final'>final</span><span class='op'>|</span>
1154
+ <span class='id identifier rubyid_final'>final</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_delete_prefix'>delete_prefix</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>@</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_variable_get'>instance_variable_get</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
1155
+ <span class='kw'>end</span>
1156
+ <span class='id identifier rubyid_return_hash'>return_hash</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:attr_triggers</span><span class='rparen'>)</span>
1157
+ <span class='id identifier rubyid_return_hash'>return_hash</span>
1158
+ <span class='kw'>end</span></pre>
1159
+ </td>
1160
+ </tr>
1161
+ </table>
1162
+ </div>
1163
+
1164
+ <div class="method_details ">
1165
+ <h3 class="signature " id="update_attrs-instance_method">
1166
+
1167
+ #<strong>update_attrs</strong>(**opts) &#x21d2; <tt>Hash&lt;Symbol, Value&gt;</tt>
1168
+
1169
+
1170
+
1171
+
1172
+
1173
+ </h3><div class="docstring">
1174
+ <div class="discussion">
1175
+
1176
+ <p>Update attribute values using a hash or keywords.</p>
1177
+
1178
+
1179
+ </div>
1180
+ </div>
1181
+ <div class="tags">
1182
+
1183
+ <p class="tag_title">Returns:</p>
1184
+ <ul class="return">
1185
+
1186
+ <li>
1187
+
1188
+
1189
+ <span class='type'>(<tt>Hash&lt;Symbol, Value&gt;</tt>)</span>
1190
+
1191
+
1192
+
1193
+ &mdash;
1194
+ <div class='inline'>
1195
+ <p>Hash of updated attributes</p>
1196
+ </div>
1197
+
1198
+ </li>
1199
+
1200
+ </ul>
1201
+
1202
+ </div><table class="source_code">
1203
+ <tr>
1204
+ <td>
1205
+ <pre class="lines">
1206
+
1207
+
1208
+ 228
1209
+ 229
1210
+ 230
1211
+ 231
1212
+ 232</pre>
1213
+ </td>
1214
+ <td>
1215
+ <pre class="code"><span class="info file"># File 'lib/felecs/component_manager.rb', line 228</span>
1216
+
1217
+ <span class='kw'>def</span> <span class='id identifier rubyid_update_attrs'>update_attrs</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
1218
+ <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
1219
+ <span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span>
1220
+ <span class='kw'>end</span>
1221
+ <span class='kw'>end</span></pre>
1222
+ </td>
1223
+ </tr>
1224
+ </table>
1225
+ </div>
1226
+
1227
+ </div>
1228
+
1229
+ </div>
1230
+
1231
+ <div id="footer">
1232
+ Generated on Wed Feb 2 03:29:07 2022 by
1233
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1234
+ 0.9.26 (ruby-2.7.3).
1235
+ </div>
1236
+
1237
+ </div>
1238
+ </body>
1239
+ </html>