felecs 5.0.0 → 5.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.mdown +42 -32
- data/Gemfile.lock +1 -1
- data/README.mdown +27 -0
- data/docs/FelECS/ComponentManager.html +1 -1
- data/docs/FelECS/Components.html +1 -1
- data/docs/FelECS/Entities.html +144 -1
- data/docs/FelECS/Order.html +1 -1
- data/docs/FelECS/Scenes.html +1 -1
- data/docs/FelECS/Stage.html +1 -1
- data/docs/FelECS/Systems.html +1 -1
- data/docs/FelECS.html +1 -1
- data/docs/_index.html +1 -1
- data/docs/file.README.html +1 -1
- data/docs/index.html +1 -1
- data/docs/method_list.html +30 -22
- data/docs/top-level-namespace.html +1 -1
- data/lib/felecs/entity_manager.rb +33 -0
- data/lib/felecs/version.rb +1 -1
- data/mrbgem/mrblib/felecs.rb +34 -1
- metadata +2 -15
- data/docs/CNAME +0 -1
- data/docs/FelFlame/ComponentManager.html +0 -1239
- data/docs/FelFlame/Components.html +0 -333
- data/docs/FelFlame/Entities.html +0 -792
- data/docs/FelFlame/Helper/ComponentManager.html +0 -1627
- data/docs/FelFlame/Helper.html +0 -142
- data/docs/FelFlame/Order.html +0 -251
- data/docs/FelFlame/Scenes.html +0 -765
- data/docs/FelFlame/Stage.html +0 -572
- data/docs/FelFlame/Systems.html +0 -1505
- data/docs/FelFlame.html +0 -319
- data/docs/Felflame_.html +0 -143
- data/docs/file.version.html +0 -74
data/docs/FelFlame/Entities.html
DELETED
@@ -1,792 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<title>
|
7
|
-
Class: FelFlame::Entities
|
8
|
-
|
9
|
-
— Documentation by YARD 0.9.26
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
|
-
|
17
|
-
<script type="text/javascript">
|
18
|
-
pathId = "FelFlame::Entities";
|
19
|
-
relpath = '../';
|
20
|
-
</script>
|
21
|
-
|
22
|
-
|
23
|
-
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
-
|
25
|
-
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
-
<div id="resizer"></div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="main" tabindex="-1">
|
36
|
-
<div id="header">
|
37
|
-
<div id="menu">
|
38
|
-
|
39
|
-
<a href="../_index.html">Index (E)</a> »
|
40
|
-
<span class='title'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span>
|
41
|
-
»
|
42
|
-
<span class="title">Entities</span>
|
43
|
-
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<div id="search">
|
47
|
-
|
48
|
-
<a class="full_list_link" id="class_list_link"
|
49
|
-
href="../class_list.html">
|
50
|
-
|
51
|
-
<svg width="24" height="24">
|
52
|
-
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
-
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
-
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
-
</svg>
|
56
|
-
</a>
|
57
|
-
|
58
|
-
</div>
|
59
|
-
<div class="clear"></div>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<div id="content"><h1>Class: FelFlame::Entities
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
</h1>
|
67
|
-
<div class="box_info">
|
68
|
-
|
69
|
-
<dl>
|
70
|
-
<dt>Inherits:</dt>
|
71
|
-
<dd>
|
72
|
-
<span class="inheritName">Object</span>
|
73
|
-
|
74
|
-
<ul class="fullTree">
|
75
|
-
<li>Object</li>
|
76
|
-
|
77
|
-
<li class="next">FelFlame::Entities</li>
|
78
|
-
|
79
|
-
</ul>
|
80
|
-
<a href="#" class="inheritanceTree">show all</a>
|
81
|
-
|
82
|
-
</dd>
|
83
|
-
</dl>
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
<dl>
|
96
|
-
<dt>Defined in:</dt>
|
97
|
-
<dd>lib/felflame.rb<span class="defines">,<br />
|
98
|
-
lib/felflame/entity_manager.rb</span>
|
99
|
-
</dd>
|
100
|
-
</dl>
|
101
|
-
|
102
|
-
</div>
|
103
|
-
|
104
|
-
<h2>Overview</h2><div class="docstring">
|
105
|
-
<div class="discussion">
|
106
|
-
|
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>
|
108
|
-
|
109
|
-
|
110
|
-
</div>
|
111
|
-
</div>
|
112
|
-
<div class="tags">
|
113
|
-
|
114
|
-
|
115
|
-
</div>
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
<h2>
|
124
|
-
Instance Method Summary
|
125
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
126
|
-
</h2>
|
127
|
-
|
128
|
-
<ul class="summary">
|
129
|
-
|
130
|
-
<li class="public ">
|
131
|
-
<span class="summary_signature">
|
132
|
-
|
133
|
-
<a href="#add-instance_method" title="#add (instance method)">#<strong>add</strong>(*components_to_add) ⇒ Boolean </a>
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
</span>
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
<span class="summary_desc"><div class='inline'>
|
148
|
-
<p>Add any number components to the Entity.</p>
|
149
|
-
</div></span>
|
150
|
-
|
151
|
-
</li>
|
152
|
-
|
153
|
-
|
154
|
-
<li class="public ">
|
155
|
-
<span class="summary_signature">
|
156
|
-
|
157
|
-
<a href="#component-instance_method" title="#component (instance method)">#<strong>component</strong>(manager = nil) ⇒ Component </a>
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
</span>
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
<span class="summary_desc"><div class='inline'>
|
172
|
-
<p>A single component from a component manager.</p>
|
173
|
-
</div></span>
|
174
|
-
|
175
|
-
</li>
|
176
|
-
|
177
|
-
|
178
|
-
<li class="public ">
|
179
|
-
<span class="summary_signature">
|
180
|
-
|
181
|
-
<a href="#components-instance_method" title="#components (instance method)">#<strong>components</strong> ⇒ Hash<Component_Manager, Array<Integer>> </a>
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
</span>
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
<span class="summary_desc"><div class='inline'>
|
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>
|
197
|
-
</div></span>
|
198
|
-
|
199
|
-
</li>
|
200
|
-
|
201
|
-
|
202
|
-
<li class="public ">
|
203
|
-
<span class="summary_signature">
|
204
|
-
|
205
|
-
<a href="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong> ⇒ Boolean </a>
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
</span>
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
<span class="summary_desc"><div class='inline'>
|
220
|
-
<p>Removes this Entity from the list and purges all references to this Entity from other Components, as well as its data.</p>
|
221
|
-
</div></span>
|
222
|
-
|
223
|
-
</li>
|
224
|
-
|
225
|
-
|
226
|
-
<li class="public ">
|
227
|
-
<span class="summary_signature">
|
228
|
-
|
229
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(*components) ⇒ Entity </a>
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
</span>
|
234
|
-
|
235
|
-
|
236
|
-
<span class="note title constructor">constructor</span>
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
<span class="summary_desc"><div class='inline'>
|
246
|
-
<p>Creating a new Entity.</p>
|
247
|
-
</div></span>
|
248
|
-
|
249
|
-
</li>
|
250
|
-
|
251
|
-
|
252
|
-
<li class="public ">
|
253
|
-
<span class="summary_signature">
|
254
|
-
|
255
|
-
<a href="#remove-instance_method" title="#remove (instance method)">#<strong>remove</strong>(*components_to_remove) ⇒ Boolean </a>
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
</span>
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
<span class="summary_desc"><div class='inline'>
|
270
|
-
<p>Remove a component from the Entity.</p>
|
271
|
-
</div></span>
|
272
|
-
|
273
|
-
</li>
|
274
|
-
|
275
|
-
|
276
|
-
</ul>
|
277
|
-
|
278
|
-
|
279
|
-
<div id="constructor_details" class="method_details_list">
|
280
|
-
<h2>Constructor Details</h2>
|
281
|
-
|
282
|
-
<div class="method_details first">
|
283
|
-
<h3 class="signature first" id="initialize-instance_method">
|
284
|
-
|
285
|
-
#<strong>initialize</strong>(*components) ⇒ <tt>Entity</tt>
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
</h3><div class="docstring">
|
292
|
-
<div class="discussion">
|
293
|
-
|
294
|
-
<p>Creating a new Entity</p>
|
295
|
-
|
296
|
-
|
297
|
-
</div>
|
298
|
-
</div>
|
299
|
-
<div class="tags">
|
300
|
-
<p class="tag_title">Parameters:</p>
|
301
|
-
<ul class="param">
|
302
|
-
|
303
|
-
<li>
|
304
|
-
|
305
|
-
<span class='name'>components</span>
|
306
|
-
|
307
|
-
|
308
|
-
<span class='type'>(<tt><span class='object_link'><a href="Components.html" title="FelFlame::Components (module)">Components</a></span></tt>)</span>
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
—
|
313
|
-
<div class='inline'>
|
314
|
-
<p>Can be any number of components, identical duplicates will be automatically purged however different components from the same component manager are allowed.</p>
|
315
|
-
</div>
|
316
|
-
|
317
|
-
</li>
|
318
|
-
|
319
|
-
</ul>
|
320
|
-
|
321
|
-
|
322
|
-
</div><table class="source_code">
|
323
|
-
<tr>
|
324
|
-
<td>
|
325
|
-
<pre class="lines">
|
326
|
-
|
327
|
-
|
328
|
-
8
|
329
|
-
9
|
330
|
-
10
|
331
|
-
11
|
332
|
-
12</pre>
|
333
|
-
</td>
|
334
|
-
<td>
|
335
|
-
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 8</span>
|
336
|
-
|
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>
|
338
|
-
<span class='comment'># Add each component
|
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>
|
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>
|
341
|
-
<span class='kw'>end</span></pre>
|
342
|
-
</td>
|
343
|
-
</tr>
|
344
|
-
</table>
|
345
|
-
</div>
|
346
|
-
|
347
|
-
</div>
|
348
|
-
|
349
|
-
|
350
|
-
<div id="instance_method_details" class="method_details_list">
|
351
|
-
<h2>Instance Method Details</h2>
|
352
|
-
|
353
|
-
|
354
|
-
<div class="method_details first">
|
355
|
-
<h3 class="signature first" id="add-instance_method">
|
356
|
-
|
357
|
-
#<strong>add</strong>(*components_to_add) ⇒ <tt>Boolean</tt>
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
</h3><div class="docstring">
|
364
|
-
<div class="discussion">
|
365
|
-
|
366
|
-
<p>Add any number components to the Entity.</p>
|
367
|
-
|
368
|
-
|
369
|
-
</div>
|
370
|
-
</div>
|
371
|
-
<div class="tags">
|
372
|
-
<p class="tag_title">Parameters:</p>
|
373
|
-
<ul class="param">
|
374
|
-
|
375
|
-
<li>
|
376
|
-
|
377
|
-
<span class='name'>components_to_add</span>
|
378
|
-
|
379
|
-
|
380
|
-
<span class='type'>(<tt>Component</tt>)</span>
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
—
|
385
|
-
<div class='inline'>
|
386
|
-
<p>Any number of components created from any component manager</p>
|
387
|
-
</div>
|
388
|
-
|
389
|
-
</li>
|
390
|
-
|
391
|
-
</ul>
|
392
|
-
|
393
|
-
<p class="tag_title">Returns:</p>
|
394
|
-
<ul class="return">
|
395
|
-
|
396
|
-
<li>
|
397
|
-
|
398
|
-
|
399
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
—
|
404
|
-
<div class='inline'>
|
405
|
-
<p><code>true</code></p>
|
406
|
-
</div>
|
407
|
-
|
408
|
-
</li>
|
409
|
-
|
410
|
-
</ul>
|
411
|
-
|
412
|
-
</div><table class="source_code">
|
413
|
-
<tr>
|
414
|
-
<td>
|
415
|
-
<pre class="lines">
|
416
|
-
|
417
|
-
|
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>
|
432
|
-
</td>
|
433
|
-
<td>
|
434
|
-
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 57</span>
|
435
|
-
|
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>
|
449
|
-
<span class='kw'>end</span></pre>
|
450
|
-
</td>
|
451
|
-
</tr>
|
452
|
-
</table>
|
453
|
-
</div>
|
454
|
-
|
455
|
-
<div class="method_details ">
|
456
|
-
<h3 class="signature " id="component-instance_method">
|
457
|
-
|
458
|
-
#<strong>component</strong>(manager = nil) ⇒ <tt>Component</tt>
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
</h3><div class="docstring">
|
465
|
-
<div class="discussion">
|
466
|
-
|
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>
|
468
|
-
|
469
|
-
|
470
|
-
</div>
|
471
|
-
</div>
|
472
|
-
<div class="tags">
|
473
|
-
|
474
|
-
<div class="examples">
|
475
|
-
<p class="tag_title">Examples:</p>
|
476
|
-
|
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>
|
480
|
-
|
481
|
-
</div>
|
482
|
-
<p class="tag_title">Parameters:</p>
|
483
|
-
<ul class="param">
|
484
|
-
|
485
|
-
<li>
|
486
|
-
|
487
|
-
<span class='name'>manager</span>
|
488
|
-
|
489
|
-
|
490
|
-
<span class='type'>(<tt><span class='object_link'><a href="ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span></tt>)</span>
|
491
|
-
|
492
|
-
|
493
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
494
|
-
|
495
|
-
|
496
|
-
—
|
497
|
-
<div class='inline'>
|
498
|
-
<p>If you pass nil you can then use array notation to access the same value.</p>
|
499
|
-
</div>
|
500
|
-
|
501
|
-
</li>
|
502
|
-
|
503
|
-
</ul>
|
504
|
-
|
505
|
-
<p class="tag_title">Returns:</p>
|
506
|
-
<ul class="return">
|
507
|
-
|
508
|
-
<li>
|
509
|
-
|
510
|
-
|
511
|
-
<span class='type'>(<tt>Component</tt>)</span>
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
</li>
|
516
|
-
|
517
|
-
</ul>
|
518
|
-
|
519
|
-
</div><table class="source_code">
|
520
|
-
<tr>
|
521
|
-
<td>
|
522
|
-
<pre class="lines">
|
523
|
-
|
524
|
-
|
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>
|
539
|
-
</td>
|
540
|
-
<td>
|
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>
|
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>
|
555
|
-
<span class='kw'>end</span>
|
556
|
-
<span class='kw'>end</span></pre>
|
557
|
-
</td>
|
558
|
-
</tr>
|
559
|
-
</table>
|
560
|
-
</div>
|
561
|
-
|
562
|
-
<div class="method_details ">
|
563
|
-
<h3 class="signature " id="components-instance_method">
|
564
|
-
|
565
|
-
#<strong>components</strong> ⇒ <tt>Hash<Component_Manager, Array<Integer>></tt>
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
</h3><div class="docstring">
|
572
|
-
<div class="discussion">
|
573
|
-
|
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>
|
575
|
-
|
576
|
-
|
577
|
-
</div>
|
578
|
-
</div>
|
579
|
-
<div class="tags">
|
580
|
-
|
581
|
-
<p class="tag_title">Returns:</p>
|
582
|
-
<ul class="return">
|
583
|
-
|
584
|
-
<li>
|
585
|
-
|
586
|
-
|
587
|
-
<span class='type'>(<tt>Hash<Component_Manager, Array<Integer>></tt>)</span>
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
</li>
|
592
|
-
|
593
|
-
</ul>
|
594
|
-
|
595
|
-
</div><table class="source_code">
|
596
|
-
<tr>
|
597
|
-
<td>
|
598
|
-
<pre class="lines">
|
599
|
-
|
600
|
-
|
601
|
-
16
|
602
|
-
17
|
603
|
-
18</pre>
|
604
|
-
</td>
|
605
|
-
<td>
|
606
|
-
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 16</span>
|
607
|
-
|
608
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_components'>components</span>
|
609
|
-
<span class='ivar'>@components</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
610
|
-
<span class='kw'>end</span></pre>
|
611
|
-
</td>
|
612
|
-
</tr>
|
613
|
-
</table>
|
614
|
-
</div>
|
615
|
-
|
616
|
-
<div class="method_details ">
|
617
|
-
<h3 class="signature " id="delete-instance_method">
|
618
|
-
|
619
|
-
#<strong>delete</strong> ⇒ <tt>Boolean</tt>
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
</h3><div class="docstring">
|
626
|
-
<div class="discussion">
|
627
|
-
|
628
|
-
<p>Removes this Entity from the list and purges all references to this Entity from other Components, as well as its data.</p>
|
629
|
-
|
630
|
-
|
631
|
-
</div>
|
632
|
-
</div>
|
633
|
-
<div class="tags">
|
634
|
-
|
635
|
-
<p class="tag_title">Returns:</p>
|
636
|
-
<ul class="return">
|
637
|
-
|
638
|
-
<li>
|
639
|
-
|
640
|
-
|
641
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
—
|
646
|
-
<div class='inline'>
|
647
|
-
<p><code>true</code></p>
|
648
|
-
</div>
|
649
|
-
|
650
|
-
</li>
|
651
|
-
|
652
|
-
</ul>
|
653
|
-
|
654
|
-
</div><table class="source_code">
|
655
|
-
<tr>
|
656
|
-
<td>
|
657
|
-
<pre class="lines">
|
658
|
-
|
659
|
-
|
660
|
-
43
|
661
|
-
44
|
662
|
-
45
|
663
|
-
46
|
664
|
-
47
|
665
|
-
48
|
666
|
-
49
|
667
|
-
50
|
668
|
-
51
|
669
|
-
52</pre>
|
670
|
-
</td>
|
671
|
-
<td>
|
672
|
-
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 43</span>
|
673
|
-
|
674
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
|
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>
|
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>
|
678
|
-
<span class='kw'>end</span>
|
679
|
-
<span class='kw'>end</span>
|
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>
|
681
|
-
<span class='ivar'>@components</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
682
|
-
<span class='kw'>true</span>
|
683
|
-
<span class='kw'>end</span></pre>
|
684
|
-
</td>
|
685
|
-
</tr>
|
686
|
-
</table>
|
687
|
-
</div>
|
688
|
-
|
689
|
-
<div class="method_details ">
|
690
|
-
<h3 class="signature " id="remove-instance_method">
|
691
|
-
|
692
|
-
#<strong>remove</strong>(*components_to_remove) ⇒ <tt>Boolean</tt>
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
</h3><div class="docstring">
|
699
|
-
<div class="discussion">
|
700
|
-
|
701
|
-
<p>Remove a component from the Entity</p>
|
702
|
-
|
703
|
-
|
704
|
-
</div>
|
705
|
-
</div>
|
706
|
-
<div class="tags">
|
707
|
-
<p class="tag_title">Parameters:</p>
|
708
|
-
<ul class="param">
|
709
|
-
|
710
|
-
<li>
|
711
|
-
|
712
|
-
<span class='name'>components_to_remove</span>
|
713
|
-
|
714
|
-
|
715
|
-
<span class='type'>(<tt>Component</tt>)</span>
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
—
|
720
|
-
<div class='inline'>
|
721
|
-
<p>A component created from any component manager</p>
|
722
|
-
</div>
|
723
|
-
|
724
|
-
</li>
|
725
|
-
|
726
|
-
</ul>
|
727
|
-
|
728
|
-
<p class="tag_title">Returns:</p>
|
729
|
-
<ul class="return">
|
730
|
-
|
731
|
-
<li>
|
732
|
-
|
733
|
-
|
734
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
—
|
739
|
-
<div class='inline'>
|
740
|
-
<p><code>true</code></p>
|
741
|
-
</div>
|
742
|
-
|
743
|
-
</li>
|
744
|
-
|
745
|
-
</ul>
|
746
|
-
|
747
|
-
</div><table class="source_code">
|
748
|
-
<tr>
|
749
|
-
<td>
|
750
|
-
<pre class="lines">
|
751
|
-
|
752
|
-
|
753
|
-
87
|
754
|
-
88
|
755
|
-
89
|
756
|
-
90
|
757
|
-
91
|
758
|
-
92
|
759
|
-
93
|
760
|
-
94
|
761
|
-
95</pre>
|
762
|
-
</td>
|
763
|
-
<td>
|
764
|
-
<pre class="code"><span class="info file"># File 'lib/felflame/entity_manager.rb', line 87</span>
|
765
|
-
|
766
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_components_to_remove'>components_to_remove</span><span class='rparen'>)</span>
|
767
|
-
<span class='id identifier rubyid_components_to_remove'>components_to_remove</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span>
|
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>
|
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>
|
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>
|
772
|
-
<span class='kw'>end</span>
|
773
|
-
<span class='kw'>true</span>
|
774
|
-
<span class='kw'>end</span></pre>
|
775
|
-
</td>
|
776
|
-
</tr>
|
777
|
-
</table>
|
778
|
-
</div>
|
779
|
-
|
780
|
-
</div>
|
781
|
-
|
782
|
-
</div>
|
783
|
-
|
784
|
-
<div id="footer">
|
785
|
-
Generated on Mon Jan 3 08:23:04 2022 by
|
786
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
787
|
-
0.9.26 (ruby-2.7.3).
|
788
|
-
</div>
|
789
|
-
|
790
|
-
</div>
|
791
|
-
</body>
|
792
|
-
</html>
|