felflame 3.0.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -2
- data/.ruby-version +1 -0
- data/CHANGELOG.mdown +47 -27
- data/Gemfile +2 -3
- data/Gemfile.lock +1 -1
- data/README.mdown +116 -81
- data/Rakefile +29 -9
- data/bin/console +3 -3
- data/docs/FelFlame/ComponentManager.html +129 -519
- data/docs/FelFlame/Components.html +22 -120
- data/docs/FelFlame/Entities.html +117 -377
- data/docs/FelFlame/Order.html +251 -0
- data/docs/FelFlame/Scenes.html +68 -66
- data/docs/FelFlame/Stage.html +28 -54
- data/docs/FelFlame/Systems.html +206 -242
- data/docs/FelFlame.html +32 -30
- data/docs/Felflame_.html +2 -2
- data/docs/_index.html +19 -4
- data/docs/class_list.html +1 -1
- data/docs/file.README.html +125 -87
- data/docs/index.html +125 -87
- data/docs/method_list.html +37 -93
- data/docs/top-level-namespace.html +4 -6
- data/felflame.gemspec +21 -21
- data/lib/felflame/component_manager.rb +98 -71
- data/lib/felflame/entity_manager.rb +75 -49
- data/lib/felflame/order.rb +24 -0
- data/lib/felflame/scene_manager.rb +23 -12
- data/lib/felflame/stage_manager.rb +10 -33
- data/lib/felflame/system_manager.rb +92 -47
- data/lib/felflame/version.rb +1 -1
- data/lib/felflame.rb +22 -14
- metadata +32 -29
data/docs/FelFlame/Entities.html
CHANGED
@@ -37,7 +37,7 @@
|
|
37
37
|
<div id="menu">
|
38
38
|
|
39
39
|
<a href="../_index.html">Index (E)</a> »
|
40
|
-
<span class='title'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (
|
40
|
+
<span class='title'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span>
|
41
41
|
»
|
42
42
|
<span class="title">Entities</span>
|
43
43
|
|
@@ -85,11 +85,6 @@
|
|
85
85
|
|
86
86
|
|
87
87
|
|
88
|
-
<dl>
|
89
|
-
<dt>Extended by:</dt>
|
90
|
-
<dd>Enumerable</dd>
|
91
|
-
</dl>
|
92
|
-
|
93
88
|
|
94
89
|
|
95
90
|
|
@@ -109,7 +104,7 @@
|
|
109
104
|
<h2>Overview</h2><div class="docstring">
|
110
105
|
<div class="discussion">
|
111
106
|
|
112
|
-
<p>Creates and manages Entities.
|
107
|
+
<p>Creates and manages Entities. Entities are just collections of Components. You can use array methods directly on this class to access Entities.</p>
|
113
108
|
|
114
109
|
|
115
110
|
</div>
|
@@ -121,46 +116,12 @@
|
|
121
116
|
|
122
117
|
|
123
118
|
|
124
|
-
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
125
|
-
<ul class="summary">
|
126
|
-
|
127
|
-
<li class="public ">
|
128
|
-
<span class="summary_signature">
|
129
|
-
|
130
|
-
<a href="#id-instance_method" title="#id (instance method)">#<strong>id</strong> ⇒ Integer </a>
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
</span>
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
<span class="note title readonly">readonly</span>
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
<span class="summary_desc"><div class='inline'>
|
150
|
-
<p>Holds the unique ID of this entity.</p>
|
151
|
-
</div></span>
|
152
|
-
|
153
|
-
</li>
|
154
|
-
|
155
|
-
|
156
|
-
</ul>
|
157
|
-
|
158
119
|
|
159
120
|
|
160
121
|
|
161
122
|
|
162
123
|
<h2>
|
163
|
-
|
124
|
+
Instance Method Summary
|
164
125
|
<small><a href="#" class="summary_toggle">collapse</a></small>
|
165
126
|
</h2>
|
166
127
|
|
@@ -169,31 +130,7 @@
|
|
169
130
|
<li class="public ">
|
170
131
|
<span class="summary_signature">
|
171
132
|
|
172
|
-
<a href="#
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
</span>
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
<span class="summary_desc"><div class='inline'>
|
187
|
-
<p>Gets an Entity from the given <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">unique ID</a></span>.</p>
|
188
|
-
</div></span>
|
189
|
-
|
190
|
-
</li>
|
191
|
-
|
192
|
-
|
193
|
-
<li class="public ">
|
194
|
-
<span class="summary_signature">
|
195
|
-
|
196
|
-
<a href="#each-class_method" title="each (class method)">.<strong>each</strong>(&block) ⇒ Enumerator </a>
|
133
|
+
<a href="#add-instance_method" title="#add (instance method)">#<strong>add</strong>(*components_to_add) ⇒ Boolean </a>
|
197
134
|
|
198
135
|
|
199
136
|
|
@@ -208,25 +145,16 @@
|
|
208
145
|
|
209
146
|
|
210
147
|
<span class="summary_desc"><div class='inline'>
|
211
|
-
<p>
|
148
|
+
<p>Add any number components to the Entity.</p>
|
212
149
|
</div></span>
|
213
150
|
|
214
151
|
</li>
|
215
152
|
|
216
153
|
|
217
|
-
</ul>
|
218
|
-
|
219
|
-
<h2>
|
220
|
-
Instance Method Summary
|
221
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
222
|
-
</h2>
|
223
|
-
|
224
|
-
<ul class="summary">
|
225
|
-
|
226
154
|
<li class="public ">
|
227
155
|
<span class="summary_signature">
|
228
156
|
|
229
|
-
<a href="#
|
157
|
+
<a href="#component-instance_method" title="#component (instance method)">#<strong>component</strong>(manager = nil) ⇒ Component </a>
|
230
158
|
|
231
159
|
|
232
160
|
|
@@ -241,7 +169,7 @@
|
|
241
169
|
|
242
170
|
|
243
171
|
<span class="summary_desc"><div class='inline'>
|
244
|
-
<p>
|
172
|
+
<p>A single component from a component manager.</p>
|
245
173
|
</div></span>
|
246
174
|
|
247
175
|
</li>
|
@@ -265,7 +193,7 @@
|
|
265
193
|
|
266
194
|
|
267
195
|
<span class="summary_desc"><div class='inline'>
|
268
|
-
<p>A hash that uses component manager constant names as keys, and where the values of those keys are arrays that contain the
|
196
|
+
<p>A hash that uses component manager constant names as keys, and where the values of those keys are arrays that contain the the components attached to this entity.</p>
|
269
197
|
</div></span>
|
270
198
|
|
271
199
|
</li>
|
@@ -289,7 +217,7 @@
|
|
289
217
|
|
290
218
|
|
291
219
|
<span class="summary_desc"><div class='inline'>
|
292
|
-
<p>Removes this Entity from the list and purges all references to this Entity from other Components, as well as its
|
220
|
+
<p>Removes this Entity from the list and purges all references to this Entity from other Components, as well as its data.</p>
|
293
221
|
</div></span>
|
294
222
|
|
295
223
|
</li>
|
@@ -342,38 +270,13 @@
|
|
342
270
|
<p>Remove a component from the Entity.</p>
|
343
271
|
</div></span>
|
344
272
|
|
345
|
-
</li>
|
346
|
-
|
347
|
-
|
348
|
-
<li class="public ">
|
349
|
-
<span class="summary_signature">
|
350
|
-
|
351
|
-
<a href="#to_i-instance_method" title="#to_i (instance method)">#<strong>to_i</strong> ⇒ Integer </a>
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
</span>
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
<span class="summary_desc"><div class='inline'>
|
366
|
-
<p>An alias for the <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">ID reader</a></span>.</p>
|
367
|
-
</div></span>
|
368
|
-
|
369
273
|
</li>
|
370
274
|
|
371
275
|
|
372
276
|
</ul>
|
373
277
|
|
374
278
|
|
375
|
-
|
376
|
-
<div id="constructor_details" class="method_details_list">
|
279
|
+
<div id="constructor_details" class="method_details_list">
|
377
280
|
<h2>Constructor Details</h2>
|
378
281
|
|
379
282
|
<div class="method_details first">
|
@@ -402,7 +305,7 @@
|
|
402
305
|
<span class='name'>components</span>
|
403
306
|
|
404
307
|
|
405
|
-
<span class='type'>(<tt><span class='object_link'><a href="Components.html" title="FelFlame::Components (
|
308
|
+
<span class='type'>(<tt><span class='object_link'><a href="Components.html" title="FelFlame::Components (module)">Components</a></span></tt>)</span>
|
406
309
|
|
407
310
|
|
408
311
|
|
@@ -422,31 +325,19 @@
|
|
422
325
|
<pre class="lines">
|
423
326
|
|
424
327
|
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
21
|
431
|
-
22
|
432
|
-
23
|
433
|
-
24
|
434
|
-
25
|
435
|
-
26</pre>
|
328
|
+
8
|
329
|
+
9
|
330
|
+
10
|
331
|
+
11
|
332
|
+
12</pre>
|
436
333
|
</td>
|
437
334
|
<td>
|
438
|
-
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line
|
335
|
+
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 8</span>
|
439
336
|
|
440
337
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_components'>components</span><span class='rparen'>)</span>
|
441
|
-
<span class='comment'># Assign new unique ID
|
442
|
-
</span> <span class='id identifier rubyid_new_id'>new_id</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_find_index'>find_index</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:nil?</span><span class='rparen'>)</span>
|
443
|
-
<span class='id identifier rubyid_new_id'>new_id</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_id'>new_id</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
444
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='id identifier rubyid_new_id'>new_id</span>
|
445
|
-
|
446
338
|
<span class='comment'># Add each component
|
447
339
|
</span> <span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_components'>components</span><span class='rparen'>)</span>
|
448
|
-
|
449
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_id'>id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>self</span>
|
340
|
+
<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_push'>push</span> <span class='kw'>self</span>
|
450
341
|
<span class='kw'>end</span></pre>
|
451
342
|
</td>
|
452
343
|
</tr>
|
@@ -455,76 +346,15 @@
|
|
455
346
|
|
456
347
|
</div>
|
457
348
|
|
458
|
-
<div id="instance_attr_details" class="attr_details">
|
459
|
-
<h2>Instance Attribute Details</h2>
|
460
|
-
|
461
|
-
|
462
|
-
<span id="id=-instance_method"></span>
|
463
|
-
<div class="method_details first">
|
464
|
-
<h3 class="signature first" id="id-instance_method">
|
465
|
-
|
466
|
-
#<strong>id</strong> ⇒ <tt>Integer</tt>
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
</h3><div class="docstring">
|
473
|
-
<div class="discussion">
|
474
|
-
|
475
|
-
<p>Holds the unique ID of this entity</p>
|
476
|
-
|
477
|
-
|
478
|
-
</div>
|
479
|
-
</div>
|
480
|
-
<div class="tags">
|
481
|
-
|
482
|
-
<p class="tag_title">Returns:</p>
|
483
|
-
<ul class="return">
|
484
|
-
|
485
|
-
<li>
|
486
|
-
|
487
|
-
|
488
|
-
<span class='type'>(<tt>Integer</tt>)</span>
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
</li>
|
493
|
-
|
494
|
-
</ul>
|
495
|
-
|
496
|
-
</div><table class="source_code">
|
497
|
-
<tr>
|
498
|
-
<td>
|
499
|
-
<pre class="lines">
|
500
349
|
|
501
|
-
|
502
|
-
|
503
|
-
6
|
504
|
-
7</pre>
|
505
|
-
</td>
|
506
|
-
<td>
|
507
|
-
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 5</span>
|
508
|
-
|
509
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_id'>id</span>
|
510
|
-
<span class='ivar'>@id</span>
|
511
|
-
<span class='kw'>end</span></pre>
|
512
|
-
</td>
|
513
|
-
</tr>
|
514
|
-
</table>
|
515
|
-
</div>
|
516
|
-
|
517
|
-
</div>
|
518
|
-
|
519
|
-
|
520
|
-
<div id="class_method_details" class="method_details_list">
|
521
|
-
<h2>Class Method Details</h2>
|
350
|
+
<div id="instance_method_details" class="method_details_list">
|
351
|
+
<h2>Instance Method Details</h2>
|
522
352
|
|
523
353
|
|
524
354
|
<div class="method_details first">
|
525
|
-
<h3 class="signature first" id="
|
355
|
+
<h3 class="signature first" id="add-instance_method">
|
526
356
|
|
527
|
-
|
357
|
+
#<strong>add</strong>(*components_to_add) ⇒ <tt>Boolean</tt>
|
528
358
|
|
529
359
|
|
530
360
|
|
@@ -533,33 +363,29 @@
|
|
533
363
|
</h3><div class="docstring">
|
534
364
|
<div class="discussion">
|
535
365
|
|
536
|
-
<p>
|
366
|
+
<p>Add any number components to the Entity.</p>
|
537
367
|
|
538
368
|
|
539
369
|
</div>
|
540
370
|
</div>
|
541
371
|
<div class="tags">
|
542
|
-
|
543
|
-
<div class="examples">
|
544
|
-
<p class="tag_title">Examples:</p>
|
545
|
-
|
546
|
-
|
547
|
-
<pre class="example code"><code><span class='comment'># This gets the Entity with ID 7
|
548
|
-
</span><span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Entities (class)">Entities</a></span></span><span class='lbracket'>[</span><span class='int'>7</span><span class='rbracket'>]</span></code></pre>
|
549
|
-
|
550
|
-
</div>
|
551
|
-
<p class="tag_title">Parameters:</p>
|
372
|
+
<p class="tag_title">Parameters:</p>
|
552
373
|
<ul class="param">
|
553
374
|
|
554
375
|
<li>
|
555
376
|
|
556
|
-
<span class='name'>
|
377
|
+
<span class='name'>components_to_add</span>
|
557
378
|
|
558
379
|
|
559
|
-
<span class='type'>(<tt>
|
380
|
+
<span class='type'>(<tt>Component</tt>)</span>
|
560
381
|
|
561
382
|
|
562
383
|
|
384
|
+
—
|
385
|
+
<div class='inline'>
|
386
|
+
<p>Any number of components created from any component manager</p>
|
387
|
+
</div>
|
388
|
+
|
563
389
|
</li>
|
564
390
|
|
565
391
|
</ul>
|
@@ -570,13 +396,13 @@
|
|
570
396
|
<li>
|
571
397
|
|
572
398
|
|
573
|
-
<span class='type'>(<tt>
|
399
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
574
400
|
|
575
401
|
|
576
402
|
|
577
403
|
—
|
578
404
|
<div class='inline'>
|
579
|
-
<p>
|
405
|
+
<p><code>true</code></p>
|
580
406
|
</div>
|
581
407
|
|
582
408
|
</li>
|
@@ -589,15 +415,37 @@
|
|
589
415
|
<pre class="lines">
|
590
416
|
|
591
417
|
|
592
|
-
|
593
|
-
|
594
|
-
|
418
|
+
57
|
419
|
+
58
|
420
|
+
59
|
421
|
+
60
|
422
|
+
61
|
423
|
+
62
|
424
|
+
63
|
425
|
+
64
|
426
|
+
65
|
427
|
+
66
|
428
|
+
67
|
429
|
+
68
|
430
|
+
69
|
431
|
+
70</pre>
|
595
432
|
</td>
|
596
433
|
<td>
|
597
|
-
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line
|
434
|
+
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 57</span>
|
598
435
|
|
599
|
-
<span class='kw'>def</span> <span class='
|
600
|
-
<span class='id identifier
|
436
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_components_to_add'>components_to_add</span><span class='rparen'>)</span>
|
437
|
+
<span class='id identifier rubyid_components_to_add'>components_to_add</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span>
|
438
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
439
|
+
<span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='rbracket'>]</span>
|
440
|
+
<span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='kw'>self</span>
|
441
|
+
<span class='id identifier rubyid_check_systems'>check_systems</span> <span class='id identifier rubyid_component'>component</span><span class='comma'>,</span> <span class='symbol'>:addition_triggers</span>
|
442
|
+
<span class='kw'>elsif</span> <span class='op'>!</span><span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_component'>component</span>
|
443
|
+
<span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_component'>component</span>
|
444
|
+
<span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span> <span class='kw'>self</span>
|
445
|
+
<span class='id identifier rubyid_check_systems'>check_systems</span> <span class='id identifier rubyid_component'>component</span><span class='comma'>,</span> <span class='symbol'>:addition_triggers</span>
|
446
|
+
<span class='kw'>end</span>
|
447
|
+
<span class='kw'>end</span>
|
448
|
+
<span class='kw'>true</span>
|
601
449
|
<span class='kw'>end</span></pre>
|
602
450
|
</td>
|
603
451
|
</tr>
|
@@ -605,9 +453,9 @@
|
|
605
453
|
</div>
|
606
454
|
|
607
455
|
<div class="method_details ">
|
608
|
-
<h3 class="signature " id="
|
456
|
+
<h3 class="signature " id="component-instance_method">
|
609
457
|
|
610
|
-
|
458
|
+
#<strong>component</strong>(manager = nil) ⇒ <tt>Component</tt>
|
611
459
|
|
612
460
|
|
613
461
|
|
@@ -616,87 +464,38 @@
|
|
616
464
|
</h3><div class="docstring">
|
617
465
|
<div class="discussion">
|
618
466
|
|
619
|
-
<p>
|
467
|
+
<p>A single component from a component manager. Use this if you expect the component to only belong to one entity and you want to access it. Access the component using either parameter notation or array notation. Array notation is conventional for better readablility.</p>
|
620
468
|
|
621
469
|
|
622
470
|
</div>
|
623
471
|
</div>
|
624
472
|
<div class="tags">
|
625
473
|
|
626
|
-
<
|
627
|
-
<
|
628
|
-
|
629
|
-
<li>
|
630
|
-
|
631
|
-
|
632
|
-
<span class='type'>(<tt>Enumerator</tt>)</span>
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
</li>
|
637
|
-
|
638
|
-
</ul>
|
639
|
-
|
640
|
-
</div><table class="source_code">
|
641
|
-
<tr>
|
642
|
-
<td>
|
643
|
-
<pre class="lines">
|
644
|
-
|
645
|
-
|
646
|
-
123
|
647
|
-
124
|
648
|
-
125</pre>
|
649
|
-
</td>
|
650
|
-
<td>
|
651
|
-
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 123</span>
|
652
|
-
|
653
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
654
|
-
<span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
655
|
-
<span class='kw'>end</span></pre>
|
656
|
-
</td>
|
657
|
-
</tr>
|
658
|
-
</table>
|
659
|
-
</div>
|
660
|
-
|
661
|
-
</div>
|
662
|
-
|
663
|
-
<div id="instance_method_details" class="method_details_list">
|
664
|
-
<h2>Instance Method Details</h2>
|
665
|
-
|
474
|
+
<div class="examples">
|
475
|
+
<p class="tag_title">Examples:</p>
|
666
476
|
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
#<strong>add</strong>(*components_to_add) ⇒ <tt>Boolean</tt>
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
</h3><div class="docstring">
|
677
|
-
<div class="discussion">
|
477
|
+
|
478
|
+
<pre class="example code"><code><span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_component'>component</span><span class='lbracket'>[</span><span class='ivar'>@component_manager</span><span class='rbracket'>]</span> <span class='comment'># array notation(the standard)
|
479
|
+
</span><span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_component'>component</span><span class='lparen'>(</span><span class='ivar'>@component_manager</span><span class='rparen'>)</span> <span class='comment'># method notation</span></code></pre>
|
678
480
|
|
679
|
-
<p>Add any number components to the Entity.</p>
|
680
|
-
|
681
|
-
|
682
481
|
</div>
|
683
|
-
|
684
|
-
<div class="tags">
|
685
|
-
<p class="tag_title">Parameters:</p>
|
482
|
+
<p class="tag_title">Parameters:</p>
|
686
483
|
<ul class="param">
|
687
484
|
|
688
485
|
<li>
|
689
486
|
|
690
|
-
<span class='name'>
|
487
|
+
<span class='name'>manager</span>
|
691
488
|
|
692
489
|
|
693
|
-
<span class='type'>(<tt>
|
490
|
+
<span class='type'>(<tt><span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span></tt>)</span>
|
694
491
|
|
695
492
|
|
493
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
494
|
+
|
696
495
|
|
697
496
|
—
|
698
497
|
<div class='inline'>
|
699
|
-
<p>
|
498
|
+
<p>If you pass nil you can then use array notation to access the same value.</p>
|
700
499
|
</div>
|
701
500
|
|
702
501
|
</li>
|
@@ -709,14 +508,9 @@
|
|
709
508
|
<li>
|
710
509
|
|
711
510
|
|
712
|
-
<span class='type'>(<tt>
|
713
|
-
|
511
|
+
<span class='type'>(<tt>Component</tt>)</span>
|
714
512
|
|
715
513
|
|
716
|
-
—
|
717
|
-
<div class='inline'>
|
718
|
-
<p><code>true</code></p>
|
719
|
-
</div>
|
720
514
|
|
721
515
|
</li>
|
722
516
|
|
@@ -728,37 +522,37 @@
|
|
728
522
|
<pre class="lines">
|
729
523
|
|
730
524
|
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
525
|
+
26
|
526
|
+
27
|
527
|
+
28
|
528
|
+
29
|
529
|
+
30
|
530
|
+
31
|
531
|
+
32
|
532
|
+
33
|
533
|
+
34
|
534
|
+
35
|
535
|
+
36
|
536
|
+
37
|
537
|
+
38
|
538
|
+
39</pre>
|
745
539
|
</td>
|
746
540
|
<td>
|
747
|
-
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line
|
748
|
-
|
749
|
-
<span class='kw'>def</span> <span class='id identifier
|
750
|
-
<span class='
|
751
|
-
<span class='
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
<span class='
|
758
|
-
<span class='id identifier rubyid_check_systems'>check_systems</span> <span class='id identifier rubyid_component'>component</span><span class='comma'>,</span> <span class='symbol'>:addition_triggers</span>
|
541
|
+
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 26</span>
|
542
|
+
|
543
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_component'>component</span><span class='lparen'>(</span><span class='id identifier rubyid_manager'>manager</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
544
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_manager'>manager</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
545
|
+
<span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Entities (class)">Entities</a></span></span><span class='period'>.</span><span class='id identifier rubyid_component_redirect'>component_redirect</span><span class='period'>.</span><span class='id identifier rubyid_entity'>entity</span> <span class='op'>=</span> <span class='kw'>self</span>
|
546
|
+
<span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Entities (class)">Entities</a></span></span><span class='period'>.</span><span class='id identifier rubyid_component_redirect'>component_redirect</span>
|
547
|
+
<span class='kw'>else</span>
|
548
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_manager'>manager</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
549
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>This entity(</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='embexpr_end'>}</span><span class='tstring_content'>) doesnt have any components of this type: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_manager'>manager</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
550
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_manager'>manager</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>></span> <span class='int'>1</span>
|
551
|
+
<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'>"</span><span class='tstring_content'>This entity has MANY of this component but you called the method that is intended for having a single of this component type.\nYou may have a bug in your logic.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
759
552
|
<span class='kw'>end</span>
|
553
|
+
|
554
|
+
<span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_manager'>manager</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
760
555
|
<span class='kw'>end</span>
|
761
|
-
<span class='kw'>true</span>
|
762
556
|
<span class='kw'>end</span></pre>
|
763
557
|
</td>
|
764
558
|
</tr>
|
@@ -777,7 +571,7 @@
|
|
777
571
|
</h3><div class="docstring">
|
778
572
|
<div class="discussion">
|
779
573
|
|
780
|
-
<p>A hash that uses component manager constant names as keys, and where the values of those keys are arrays that contain the
|
574
|
+
<p>A hash that uses component manager constant names as keys, and where the values of those keys are arrays that contain the the components attached to this entity.</p>
|
781
575
|
|
782
576
|
|
783
577
|
</div>
|
@@ -804,12 +598,12 @@
|
|
804
598
|
<pre class="lines">
|
805
599
|
|
806
600
|
|
807
|
-
|
808
|
-
|
809
|
-
|
601
|
+
16
|
602
|
+
17
|
603
|
+
18</pre>
|
810
604
|
</td>
|
811
605
|
<td>
|
812
|
-
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line
|
606
|
+
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 16</span>
|
813
607
|
|
814
608
|
<span class='kw'>def</span> <span class='id identifier rubyid_components'>components</span>
|
815
609
|
<span class='ivar'>@components</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
@@ -831,7 +625,7 @@
|
|
831
625
|
</h3><div class="docstring">
|
832
626
|
<div class="discussion">
|
833
627
|
|
834
|
-
<p>Removes this Entity from the list and purges all references to this Entity from other Components, as well as its
|
628
|
+
<p>Removes this Entity from the list and purges all references to this Entity from other Components, as well as its data.</p>
|
835
629
|
|
836
630
|
|
837
631
|
</div>
|
@@ -863,7 +657,6 @@
|
|
863
657
|
<pre class="lines">
|
864
658
|
|
865
659
|
|
866
|
-
42
|
867
660
|
43
|
868
661
|
44
|
869
662
|
45
|
@@ -876,17 +669,16 @@
|
|
876
669
|
52</pre>
|
877
670
|
</td>
|
878
671
|
<td>
|
879
|
-
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line
|
672
|
+
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 43</span>
|
880
673
|
|
881
674
|
<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
|
882
|
-
<span class='id identifier rubyid_components'>components</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier
|
883
|
-
<span class='id identifier rubyid_component_array'>component_array</span><span class='period'>.</span><span class='id identifier
|
675
|
+
<span class='id identifier rubyid_components'>components</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid__component_manager'>_component_manager</span><span class='comma'>,</span> <span class='id identifier rubyid_component_array'>component_array</span><span class='op'>|</span>
|
676
|
+
<span class='id identifier rubyid_component_array'>component_array</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_component'>component</span><span class='op'>|</span>
|
884
677
|
<span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
885
678
|
<span class='kw'>end</span>
|
886
679
|
<span class='kw'>end</span>
|
887
|
-
<span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (
|
680
|
+
<span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Entities (class)">Entities</a></span></span><span class='period'>.</span><span class='id identifier rubyid__data'>_data</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='kw'>self</span>
|
888
681
|
<span class='ivar'>@components</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
889
|
-
<span class='ivar'>@id</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
890
682
|
<span class='kw'>true</span>
|
891
683
|
<span class='kw'>end</span></pre>
|
892
684
|
</td>
|
@@ -965,7 +757,8 @@
|
|
965
757
|
91
|
966
758
|
92
|
967
759
|
93
|
968
|
-
94
|
760
|
+
94
|
761
|
+
95</pre>
|
969
762
|
</td>
|
970
763
|
<td>
|
971
764
|
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 87</span>
|
@@ -975,66 +768,13 @@
|
|
975
768
|
<span class='id identifier rubyid_check_systems'>check_systems</span> <span class='id identifier rubyid_component'>component</span><span class='comma'>,</span> <span class='symbol'>:removal_triggers</span> <span class='kw'>if</span> <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='kw'>self</span>
|
976
769
|
<span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='kw'>self</span>
|
977
770
|
<span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_component'>component</span>
|
771
|
+
<span class='id identifier rubyid_components'>components</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='kw'>if</span> <span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='id identifier rubyid_component'>component</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
978
772
|
<span class='kw'>end</span>
|
979
773
|
<span class='kw'>true</span>
|
980
774
|
<span class='kw'>end</span></pre>
|
981
775
|
</td>
|
982
776
|
</tr>
|
983
777
|
</table>
|
984
|
-
</div>
|
985
|
-
|
986
|
-
<div class="method_details ">
|
987
|
-
<h3 class="signature " id="to_i-instance_method">
|
988
|
-
|
989
|
-
#<strong>to_i</strong> ⇒ <tt>Integer</tt>
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
</h3><div class="docstring">
|
996
|
-
<div class="discussion">
|
997
|
-
|
998
|
-
<p>An alias for the <span class='object_link'><a href="#id-instance_method" title="FelFlame::Entities#id (method)">ID reader</a></span></p>
|
999
|
-
|
1000
|
-
|
1001
|
-
</div>
|
1002
|
-
</div>
|
1003
|
-
<div class="tags">
|
1004
|
-
|
1005
|
-
<p class="tag_title">Returns:</p>
|
1006
|
-
<ul class="return">
|
1007
|
-
|
1008
|
-
<li>
|
1009
|
-
|
1010
|
-
|
1011
|
-
<span class='type'>(<tt>Integer</tt>)</span>
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
</li>
|
1016
|
-
|
1017
|
-
</ul>
|
1018
|
-
|
1019
|
-
</div><table class="source_code">
|
1020
|
-
<tr>
|
1021
|
-
<td>
|
1022
|
-
<pre class="lines">
|
1023
|
-
|
1024
|
-
|
1025
|
-
36
|
1026
|
-
37
|
1027
|
-
38</pre>
|
1028
|
-
</td>
|
1029
|
-
<td>
|
1030
|
-
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 36</span>
|
1031
|
-
|
1032
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_to_i'>to_i</span>
|
1033
|
-
<span class='id identifier rubyid_id'>id</span>
|
1034
|
-
<span class='kw'>end</span></pre>
|
1035
|
-
</td>
|
1036
|
-
</tr>
|
1037
|
-
</table>
|
1038
778
|
</div>
|
1039
779
|
|
1040
780
|
</div>
|
@@ -1042,7 +782,7 @@
|
|
1042
782
|
</div>
|
1043
783
|
|
1044
784
|
<div id="footer">
|
1045
|
-
Generated on Mon
|
785
|
+
Generated on Mon Jan 3 08:23:04 2022 by
|
1046
786
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1047
787
|
0.9.26 (ruby-2.7.3).
|
1048
788
|
</div>
|