the-swarm 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/.yardopts +8 -0
- data/Gemfile +24 -0
- data/LICENSE.txt +22 -0
- data/README.md +35 -0
- data/Rakefile +26 -0
- data/bin/swarm +11 -0
- data/docs/Swarm.html +296 -0
- data/docs/Swarm/Catalog.html +819 -0
- data/docs/Swarm/Console.html +1050 -0
- data/docs/Swarm/Console/Color.html +160 -0
- data/docs/Swarm/Console/NormalKey.html +410 -0
- data/docs/Swarm/Console/PopUp.html +236 -0
- data/docs/Swarm/Console/VIKey.html +410 -0
- data/docs/Swarm/Five.html +421 -0
- data/docs/Swarm/Four.html +389 -0
- data/docs/Swarm/Game.html +1197 -0
- data/docs/Swarm/Intro.html +419 -0
- data/docs/Swarm/Level.html +700 -0
- data/docs/Swarm/Map.html +2336 -0
- data/docs/Swarm/One.html +353 -0
- data/docs/Swarm/Three.html +383 -0
- data/docs/Swarm/Tile.html +3823 -0
- data/docs/Swarm/Two.html +355 -0
- data/docs/_index.html +313 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +492 -0
- data/docs/file.LICENSE.html +70 -0
- data/docs/file.README.html +101 -0
- data/docs/file_list.html +61 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +101 -0
- data/docs/js/app.js +248 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +1195 -0
- data/docs/top-level-namespace.html +110 -0
- data/lib/swarm.rb +60 -0
- data/lib/swarm/catalog.rb +71 -0
- data/lib/swarm/console.rb +165 -0
- data/lib/swarm/game.rb +173 -0
- data/lib/swarm/level.rb +58 -0
- data/lib/swarm/levels/five.rb +71 -0
- data/lib/swarm/levels/four.rb +55 -0
- data/lib/swarm/levels/intro.rb +36 -0
- data/lib/swarm/levels/one.rb +35 -0
- data/lib/swarm/levels/three.rb +51 -0
- data/lib/swarm/levels/two.rb +38 -0
- data/lib/swarm/map.rb +254 -0
- data/lib/swarm/tile.rb +149 -0
- data/lib/swarm/version.rb +5 -0
- data/swarm.gemspec +24 -0
- metadata +112 -0
@@ -0,0 +1,3823 @@
|
|
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: Swarm::Tile
|
8
|
+
|
9
|
+
— "Swarm" Source Code Documentation
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "Swarm::Tile";
|
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 (T)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Swarm.html" title="Swarm (module)">Swarm</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Tile</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: Swarm::Tile
|
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">Swarm::Tile</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
<dl>
|
91
|
+
<dt>Includes:</dt>
|
92
|
+
<dd><span class='object_link'><a href="Console/Color.html" title="Swarm::Console::Color (module)">Console::Color</a></span></dd>
|
93
|
+
</dl>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
<dl>
|
101
|
+
<dt>Defined in:</dt>
|
102
|
+
<dd>lib/swarm/tile.rb</dd>
|
103
|
+
</dl>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
<h2>Constant Summary</h2>
|
111
|
+
|
112
|
+
<h3 class="inherited">Constants included
|
113
|
+
from <span class='object_link'><a href="Console/Color.html" title="Swarm::Console::Color (module)">Console::Color</a></span></h3>
|
114
|
+
<p class="inherited"><span class='object_link'><a href="Console/Color.html#BLACK-constant" title="Swarm::Console::Color::BLACK (constant)">Console::Color::BLACK</a></span>, <span class='object_link'><a href="Console/Color.html#BLUE-constant" title="Swarm::Console::Color::BLUE (constant)">Console::Color::BLUE</a></span>, <span class='object_link'><a href="Console/Color.html#GREEN-constant" title="Swarm::Console::Color::GREEN (constant)">Console::Color::GREEN</a></span>, <span class='object_link'><a href="Console/Color.html#GREY-constant" title="Swarm::Console::Color::GREY (constant)">Console::Color::GREY</a></span>, <span class='object_link'><a href="Console/Color.html#PURPLE-constant" title="Swarm::Console::Color::PURPLE (constant)">Console::Color::PURPLE</a></span>, <span class='object_link'><a href="Console/Color.html#RED-constant" title="Swarm::Console::Color::RED (constant)">Console::Color::RED</a></span>, <span class='object_link'><a href="Console/Color.html#SILVER-constant" title="Swarm::Console::Color::SILVER (constant)">Console::Color::SILVER</a></span>, <span class='object_link'><a href="Console/Color.html#WHITE-constant" title="Swarm::Console::Color::WHITE (constant)">Console::Color::WHITE</a></span>, <span class='object_link'><a href="Console/Color.html#YELLOW-constant" title="Swarm::Console::Color::YELLOW (constant)">Console::Color::YELLOW</a></span></p>
|
115
|
+
|
116
|
+
|
117
|
+
<h2>Instance 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="#age-instance_method" title="#age (instance method)">#<strong>age</strong> ⇒ Integer </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'></div></span>
|
143
|
+
|
144
|
+
</li>
|
145
|
+
|
146
|
+
|
147
|
+
<li class="public ">
|
148
|
+
<span class="summary_signature">
|
149
|
+
|
150
|
+
<a href="#color-instance_method" title="#color (instance method)">#<strong>color</strong> ⇒ Integer </a>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
</span>
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
<span class="note title readonly">readonly</span>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
170
|
+
|
171
|
+
</li>
|
172
|
+
|
173
|
+
|
174
|
+
<li class="public ">
|
175
|
+
<span class="summary_signature">
|
176
|
+
|
177
|
+
<a href="#icon-instance_method" title="#icon (instance method)">#<strong>icon</strong> ⇒ String </a>
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
</span>
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
<span class="note title readonly">readonly</span>
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
197
|
+
|
198
|
+
</li>
|
199
|
+
|
200
|
+
|
201
|
+
<li class="public ">
|
202
|
+
<span class="summary_signature">
|
203
|
+
|
204
|
+
<a href="#location-instance_method" title="#location (instance method)">#<strong>location</strong> ⇒ Object </a>
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
</span>
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
<span class="note title readonly">readonly</span>
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
<span class="summary_desc"><div class='inline'>
|
224
|
+
<p>Returns the value of attribute location.</p>
|
225
|
+
</div></span>
|
226
|
+
|
227
|
+
</li>
|
228
|
+
|
229
|
+
|
230
|
+
<li class="public ">
|
231
|
+
<span class="summary_signature">
|
232
|
+
|
233
|
+
<a href="#type-instance_method" title="#type (instance method)">#<strong>type</strong> ⇒ Symbol </a>
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
</span>
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
<span class="note title readonly">readonly</span>
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
253
|
+
|
254
|
+
</li>
|
255
|
+
|
256
|
+
|
257
|
+
<li class="public ">
|
258
|
+
<span class="summary_signature">
|
259
|
+
|
260
|
+
<a href="#x-instance_method" title="#x (instance method)">#<strong>x</strong> ⇒ Integer </a>
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
</span>
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
<span class="note title readonly">readonly</span>
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
<span class="summary_desc"><div class='inline'>
|
280
|
+
<p>The position of the <code>tile</code> on the x axis.</p>
|
281
|
+
</div></span>
|
282
|
+
|
283
|
+
</li>
|
284
|
+
|
285
|
+
|
286
|
+
<li class="public ">
|
287
|
+
<span class="summary_signature">
|
288
|
+
|
289
|
+
<a href="#y-instance_method" title="#y (instance method)">#<strong>y</strong> ⇒ Integer </a>
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
</span>
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
<span class="note title readonly">readonly</span>
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
<span class="summary_desc"><div class='inline'>
|
309
|
+
<p>The position of the <code>tile</code> on the y axis.</p>
|
310
|
+
</div></span>
|
311
|
+
|
312
|
+
</li>
|
313
|
+
|
314
|
+
|
315
|
+
</ul>
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
<h2>
|
322
|
+
Class Method Summary
|
323
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
324
|
+
</h2>
|
325
|
+
|
326
|
+
<ul class="summary">
|
327
|
+
|
328
|
+
<li class="public ">
|
329
|
+
<span class="summary_signature">
|
330
|
+
|
331
|
+
<a href="#attr_type-class_method" title="attr_type (class method)">.<strong>attr_type</strong>(type, icon: String.new, color: 0) ⇒ Object </a>
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
</span>
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
<span class="summary_desc"><div class='inline'>
|
346
|
+
<p>Create methods for setting and testing the <code>type</code> value, change
|
347
|
+
status and console color of every <code>Tile</code>.</p>
|
348
|
+
</div></span>
|
349
|
+
|
350
|
+
</li>
|
351
|
+
|
352
|
+
|
353
|
+
</ul>
|
354
|
+
|
355
|
+
<h2>
|
356
|
+
Instance Method Summary
|
357
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
358
|
+
</h2>
|
359
|
+
|
360
|
+
<ul class="summary">
|
361
|
+
|
362
|
+
<li class="public ">
|
363
|
+
<span class="summary_signature">
|
364
|
+
|
365
|
+
<a href="#===-instance_method" title="#=== (instance method)">#<strong>===</strong>(other) ⇒ Boolean </a>
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
</span>
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
380
|
+
|
381
|
+
</li>
|
382
|
+
|
383
|
+
|
384
|
+
<li class="public ">
|
385
|
+
<span class="summary_signature">
|
386
|
+
|
387
|
+
<a href="#age!-instance_method" title="#age! (instance method)">#<strong>age!</strong> ⇒ Integer </a>
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
</span>
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
402
|
+
|
403
|
+
</li>
|
404
|
+
|
405
|
+
|
406
|
+
<li class="public ">
|
407
|
+
<span class="summary_signature">
|
408
|
+
|
409
|
+
<a href="#born!-instance_method" title="#born! (instance method)">#<strong>born!</strong> ⇒ Integer </a>
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
</span>
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
424
|
+
|
425
|
+
</li>
|
426
|
+
|
427
|
+
|
428
|
+
<li class="public ">
|
429
|
+
<span class="summary_signature">
|
430
|
+
|
431
|
+
<a href="#change-instance_method" title="#change (instance method)">#<strong>change</strong> ⇒ Void </a>
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
</span>
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
446
|
+
|
447
|
+
</li>
|
448
|
+
|
449
|
+
|
450
|
+
<li class="public ">
|
451
|
+
<span class="summary_signature">
|
452
|
+
|
453
|
+
<a href="#change!-instance_method" title="#change! (instance method)">#<strong>change!</strong> ⇒ Object </a>
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
</span>
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
468
|
+
|
469
|
+
</li>
|
470
|
+
|
471
|
+
|
472
|
+
<li class="public ">
|
473
|
+
<span class="summary_signature">
|
474
|
+
|
475
|
+
<a href="#changed%3F-instance_method" title="#changed? (instance method)">#<strong>changed?</strong> ⇒ Boolean </a>
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
</span>
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
|
489
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
490
|
+
|
491
|
+
</li>
|
492
|
+
|
493
|
+
|
494
|
+
<li class="public ">
|
495
|
+
<span class="summary_signature">
|
496
|
+
|
497
|
+
<a href="#destroy!-instance_method" title="#destroy! (instance method)">#<strong>destroy!</strong> ⇒ Object </a>
|
498
|
+
|
499
|
+
|
500
|
+
|
501
|
+
</span>
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
512
|
+
|
513
|
+
</li>
|
514
|
+
|
515
|
+
|
516
|
+
<li class="public ">
|
517
|
+
<span class="summary_signature">
|
518
|
+
|
519
|
+
<a href="#dirt-instance_method" title="#dirt (instance method)">#<strong>dirt</strong> ⇒ true </a>
|
520
|
+
|
521
|
+
|
522
|
+
|
523
|
+
</span>
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
|
528
|
+
|
529
|
+
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
<span class="summary_desc"><div class='inline'>
|
534
|
+
<p>set the <code>type</code> to :dirt, the <code>icon</code> to <tt>██</tt>, the
|
535
|
+
<code>color</code> to color: SILVER, the <code>age</code> to and flags the
|
536
|
+
tile to be updated by the <code>Console</code> attr_type, dirt, ██, color:
|
537
|
+
SILVER, , , ,.</p>
|
538
|
+
</div></span>
|
539
|
+
|
540
|
+
</li>
|
541
|
+
|
542
|
+
|
543
|
+
<li class="public ">
|
544
|
+
<span class="summary_signature">
|
545
|
+
|
546
|
+
<a href="#dirt!-instance_method" title="#dirt! (instance method)">#<strong>dirt!</strong> ⇒ true </a>
|
547
|
+
|
548
|
+
|
549
|
+
|
550
|
+
</span>
|
551
|
+
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
|
558
|
+
|
559
|
+
|
560
|
+
<span class="summary_desc"><div class='inline'>
|
561
|
+
<p>set the <code>type</code> to :dirt, the <code>icon</code> to '██',
|
562
|
+
the <code>color</code> to color: SILVER, the <code>age</code> to 0, and
|
563
|
+
flags the tile to be updated by the <code>Console</code>.</p>
|
564
|
+
</div></span>
|
565
|
+
|
566
|
+
</li>
|
567
|
+
|
568
|
+
|
569
|
+
<li class="public ">
|
570
|
+
<span class="summary_signature">
|
571
|
+
|
572
|
+
<a href="#dirt%3F-instance_method" title="#dirt? (instance method)">#<strong>dirt?</strong> ⇒ Boolean </a>
|
573
|
+
|
574
|
+
|
575
|
+
|
576
|
+
</span>
|
577
|
+
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
|
584
|
+
|
585
|
+
|
586
|
+
<span class="summary_desc"><div class='inline'>
|
587
|
+
<p>test the value of <code>type</code>.</p>
|
588
|
+
</div></span>
|
589
|
+
|
590
|
+
</li>
|
591
|
+
|
592
|
+
|
593
|
+
<li class="public ">
|
594
|
+
<span class="summary_signature">
|
595
|
+
|
596
|
+
<a href="#egg-instance_method" title="#egg (instance method)">#<strong>egg</strong> ⇒ true </a>
|
597
|
+
|
598
|
+
|
599
|
+
|
600
|
+
</span>
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
|
606
|
+
|
607
|
+
|
608
|
+
|
609
|
+
|
610
|
+
<span class="summary_desc"><div class='inline'>
|
611
|
+
<p>set the <code>type</code> to :egg, the <code>icon</code> to
|
612
|
+
<code>oo</code>, the <code>color</code> to color: YELLOW, the
|
613
|
+
<code>age</code> to and flags the tile to be updated by the
|
614
|
+
<code>Console</code> attr_type, egg, oo, color: YELLOW, , , ,.</p>
|
615
|
+
</div></span>
|
616
|
+
|
617
|
+
</li>
|
618
|
+
|
619
|
+
|
620
|
+
<li class="public ">
|
621
|
+
<span class="summary_signature">
|
622
|
+
|
623
|
+
<a href="#egg!-instance_method" title="#egg! (instance method)">#<strong>egg!</strong> ⇒ true </a>
|
624
|
+
|
625
|
+
|
626
|
+
|
627
|
+
</span>
|
628
|
+
|
629
|
+
|
630
|
+
|
631
|
+
|
632
|
+
|
633
|
+
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
<span class="summary_desc"><div class='inline'>
|
638
|
+
<p>set the <code>type</code> to :egg, the <code>icon</code> to 'oo',
|
639
|
+
the <code>color</code> to color: YELLOW, the <code>age</code> to 0, and
|
640
|
+
flags the tile to be updated by the <code>Console</code>.</p>
|
641
|
+
</div></span>
|
642
|
+
|
643
|
+
</li>
|
644
|
+
|
645
|
+
|
646
|
+
<li class="public ">
|
647
|
+
<span class="summary_signature">
|
648
|
+
|
649
|
+
<a href="#egg%3F-instance_method" title="#egg? (instance method)">#<strong>egg?</strong> ⇒ Boolean </a>
|
650
|
+
|
651
|
+
|
652
|
+
|
653
|
+
</span>
|
654
|
+
|
655
|
+
|
656
|
+
|
657
|
+
|
658
|
+
|
659
|
+
|
660
|
+
|
661
|
+
|
662
|
+
|
663
|
+
<span class="summary_desc"><div class='inline'>
|
664
|
+
<p>test the value of <code>type</code>.</p>
|
665
|
+
</div></span>
|
666
|
+
|
667
|
+
</li>
|
668
|
+
|
669
|
+
|
670
|
+
<li class="public ">
|
671
|
+
<span class="summary_signature">
|
672
|
+
|
673
|
+
<a href="#empty-instance_method" title="#empty (instance method)">#<strong>empty</strong> ⇒ true </a>
|
674
|
+
|
675
|
+
|
676
|
+
|
677
|
+
</span>
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
|
682
|
+
|
683
|
+
|
684
|
+
|
685
|
+
|
686
|
+
|
687
|
+
<span class="summary_desc"><div class='inline'>
|
688
|
+
<p>set the <code>type</code> to :empty, the <code>icon</code> to + +, the
|
689
|
+
<code>color</code> to color: BLACK, the <code>age</code> to and flags the
|
690
|
+
tile to be updated by the <code>Console</code> attr_type, empty, , color:
|
691
|
+
BLACK, , , ,.</p>
|
692
|
+
</div></span>
|
693
|
+
|
694
|
+
</li>
|
695
|
+
|
696
|
+
|
697
|
+
<li class="public ">
|
698
|
+
<span class="summary_signature">
|
699
|
+
|
700
|
+
<a href="#empty!-instance_method" title="#empty! (instance method)">#<strong>empty!</strong> ⇒ true </a>
|
701
|
+
|
702
|
+
|
703
|
+
|
704
|
+
</span>
|
705
|
+
|
706
|
+
|
707
|
+
|
708
|
+
|
709
|
+
|
710
|
+
|
711
|
+
|
712
|
+
|
713
|
+
|
714
|
+
<span class="summary_desc"><div class='inline'>
|
715
|
+
<p>set the <code>type</code> to :empty, the <code>icon</code> to ' ',
|
716
|
+
the <code>color</code> to color: BLACK, the <code>age</code> to 0, and
|
717
|
+
flags the tile to be updated by the <code>Console</code>.</p>
|
718
|
+
</div></span>
|
719
|
+
|
720
|
+
</li>
|
721
|
+
|
722
|
+
|
723
|
+
<li class="public ">
|
724
|
+
<span class="summary_signature">
|
725
|
+
|
726
|
+
<a href="#empty%3F-instance_method" title="#empty? (instance method)">#<strong>empty?</strong> ⇒ Boolean </a>
|
727
|
+
|
728
|
+
|
729
|
+
|
730
|
+
</span>
|
731
|
+
|
732
|
+
|
733
|
+
|
734
|
+
|
735
|
+
|
736
|
+
|
737
|
+
|
738
|
+
|
739
|
+
|
740
|
+
<span class="summary_desc"><div class='inline'>
|
741
|
+
<p>test the value of <code>type</code>.</p>
|
742
|
+
</div></span>
|
743
|
+
|
744
|
+
</li>
|
745
|
+
|
746
|
+
|
747
|
+
<li class="public ">
|
748
|
+
<span class="summary_signature">
|
749
|
+
|
750
|
+
<a href="#enemy%3F-instance_method" title="#enemy? (instance method)">#<strong>enemy?</strong> ⇒ Boolean </a>
|
751
|
+
|
752
|
+
|
753
|
+
|
754
|
+
</span>
|
755
|
+
|
756
|
+
|
757
|
+
|
758
|
+
|
759
|
+
|
760
|
+
|
761
|
+
|
762
|
+
|
763
|
+
|
764
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
765
|
+
|
766
|
+
</li>
|
767
|
+
|
768
|
+
|
769
|
+
<li class="public ">
|
770
|
+
<span class="summary_signature">
|
771
|
+
|
772
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(map_x, map_y, location) ⇒ Tile </a>
|
773
|
+
|
774
|
+
|
775
|
+
|
776
|
+
</span>
|
777
|
+
|
778
|
+
|
779
|
+
<span class="note title constructor">constructor</span>
|
780
|
+
|
781
|
+
|
782
|
+
|
783
|
+
|
784
|
+
|
785
|
+
|
786
|
+
|
787
|
+
|
788
|
+
<span class="summary_desc"><div class='inline'>
|
789
|
+
<p>Initialize a <code>Tile</code> with the <code>x</code> and both
|
790
|
+
<code>y</code> positions (<code>Console</code> and <code>Map</code>) on the
|
791
|
+
<code>Console</code>.</p>
|
792
|
+
</div></span>
|
793
|
+
|
794
|
+
</li>
|
795
|
+
|
796
|
+
|
797
|
+
<li class="public ">
|
798
|
+
<span class="summary_signature">
|
799
|
+
|
800
|
+
<a href="#inspect-instance_method" title="#inspect (instance method)">#<strong>inspect</strong> ⇒ Object </a>
|
801
|
+
|
802
|
+
|
803
|
+
|
804
|
+
</span>
|
805
|
+
|
806
|
+
|
807
|
+
|
808
|
+
|
809
|
+
|
810
|
+
|
811
|
+
|
812
|
+
|
813
|
+
|
814
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
815
|
+
|
816
|
+
</li>
|
817
|
+
|
818
|
+
|
819
|
+
<li class="public ">
|
820
|
+
<span class="summary_signature">
|
821
|
+
|
822
|
+
<a href="#mover%3F-instance_method" title="#mover? (instance method)">#<strong>mover?</strong> ⇒ Boolean </a>
|
823
|
+
|
824
|
+
|
825
|
+
|
826
|
+
</span>
|
827
|
+
|
828
|
+
|
829
|
+
|
830
|
+
|
831
|
+
|
832
|
+
|
833
|
+
|
834
|
+
|
835
|
+
|
836
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
837
|
+
|
838
|
+
</li>
|
839
|
+
|
840
|
+
|
841
|
+
<li class="public ">
|
842
|
+
<span class="summary_signature">
|
843
|
+
|
844
|
+
<a href="#player-instance_method" title="#player (instance method)">#<strong>player</strong> ⇒ true </a>
|
845
|
+
|
846
|
+
|
847
|
+
|
848
|
+
</span>
|
849
|
+
|
850
|
+
|
851
|
+
|
852
|
+
|
853
|
+
|
854
|
+
|
855
|
+
|
856
|
+
|
857
|
+
|
858
|
+
<span class="summary_desc"><div class='inline'>
|
859
|
+
<p>set the <code>type</code> to :player, the <code>icon</code> to <tt>◄▶</tt>, the
|
860
|
+
<code>color</code> to color: GREEN, the <code>age</code> to and flags the
|
861
|
+
tile to be updated by the <code>Console</code> attr_type, player, ◄▶,
|
862
|
+
color: GREEN, , , ,.</p>
|
863
|
+
</div></span>
|
864
|
+
|
865
|
+
</li>
|
866
|
+
|
867
|
+
|
868
|
+
<li class="public ">
|
869
|
+
<span class="summary_signature">
|
870
|
+
|
871
|
+
<a href="#player!-instance_method" title="#player! (instance method)">#<strong>player!</strong> ⇒ true </a>
|
872
|
+
|
873
|
+
|
874
|
+
|
875
|
+
</span>
|
876
|
+
|
877
|
+
|
878
|
+
|
879
|
+
|
880
|
+
|
881
|
+
|
882
|
+
|
883
|
+
|
884
|
+
|
885
|
+
<span class="summary_desc"><div class='inline'>
|
886
|
+
<p>set the <code>type</code> to :player, the <code>icon</code> to
|
887
|
+
'◄▶', the <code>color</code> to color: GREEN, the <code>age</code>
|
888
|
+
to 0, and flags the tile to be updated by the <code>Console</code>.</p>
|
889
|
+
</div></span>
|
890
|
+
|
891
|
+
</li>
|
892
|
+
|
893
|
+
|
894
|
+
<li class="public ">
|
895
|
+
<span class="summary_signature">
|
896
|
+
|
897
|
+
<a href="#player%3F-instance_method" title="#player? (instance method)">#<strong>player?</strong> ⇒ Boolean </a>
|
898
|
+
|
899
|
+
|
900
|
+
|
901
|
+
</span>
|
902
|
+
|
903
|
+
|
904
|
+
|
905
|
+
|
906
|
+
|
907
|
+
|
908
|
+
|
909
|
+
|
910
|
+
|
911
|
+
<span class="summary_desc"><div class='inline'>
|
912
|
+
<p>test the value of <code>type</code>.</p>
|
913
|
+
</div></span>
|
914
|
+
|
915
|
+
</li>
|
916
|
+
|
917
|
+
|
918
|
+
<li class="public ">
|
919
|
+
<span class="summary_signature">
|
920
|
+
|
921
|
+
<a href="#queen-instance_method" title="#queen (instance method)">#<strong>queen</strong> ⇒ true </a>
|
922
|
+
|
923
|
+
|
924
|
+
|
925
|
+
</span>
|
926
|
+
|
927
|
+
|
928
|
+
|
929
|
+
|
930
|
+
|
931
|
+
|
932
|
+
|
933
|
+
|
934
|
+
|
935
|
+
<span class="summary_desc"><div class='inline'>
|
936
|
+
<p>set the <code>type</code> to :queen, the <code>icon</code> to <tt>╬╬</tt>, the
|
937
|
+
<code>color</code> to color: PURPLE, the <code>age</code> to and flags the
|
938
|
+
tile to be updated by the <code>Console</code> attr_type, queen, ╬╬, color:
|
939
|
+
PURPLE, , , ,.</p>
|
940
|
+
</div></span>
|
941
|
+
|
942
|
+
</li>
|
943
|
+
|
944
|
+
|
945
|
+
<li class="public ">
|
946
|
+
<span class="summary_signature">
|
947
|
+
|
948
|
+
<a href="#queen!-instance_method" title="#queen! (instance method)">#<strong>queen!</strong> ⇒ true </a>
|
949
|
+
|
950
|
+
|
951
|
+
|
952
|
+
</span>
|
953
|
+
|
954
|
+
|
955
|
+
|
956
|
+
|
957
|
+
|
958
|
+
|
959
|
+
|
960
|
+
|
961
|
+
|
962
|
+
<span class="summary_desc"><div class='inline'>
|
963
|
+
<p>set the <code>type</code> to :queen, the <code>icon</code> to '╬╬',
|
964
|
+
the <code>color</code> to color: PURPLE, the <code>age</code> to 0, and
|
965
|
+
flags the tile to be updated by the <code>Console</code>.</p>
|
966
|
+
</div></span>
|
967
|
+
|
968
|
+
</li>
|
969
|
+
|
970
|
+
|
971
|
+
<li class="public ">
|
972
|
+
<span class="summary_signature">
|
973
|
+
|
974
|
+
<a href="#queen%3F-instance_method" title="#queen? (instance method)">#<strong>queen?</strong> ⇒ Boolean </a>
|
975
|
+
|
976
|
+
|
977
|
+
|
978
|
+
</span>
|
979
|
+
|
980
|
+
|
981
|
+
|
982
|
+
|
983
|
+
|
984
|
+
|
985
|
+
|
986
|
+
|
987
|
+
|
988
|
+
<span class="summary_desc"><div class='inline'>
|
989
|
+
<p>test the value of <code>type</code>.</p>
|
990
|
+
</div></span>
|
991
|
+
|
992
|
+
</li>
|
993
|
+
|
994
|
+
|
995
|
+
<li class="public ">
|
996
|
+
<span class="summary_signature">
|
997
|
+
|
998
|
+
<a href="#rock-instance_method" title="#rock (instance method)">#<strong>rock</strong> ⇒ true </a>
|
999
|
+
|
1000
|
+
|
1001
|
+
|
1002
|
+
</span>
|
1003
|
+
|
1004
|
+
|
1005
|
+
|
1006
|
+
|
1007
|
+
|
1008
|
+
|
1009
|
+
|
1010
|
+
|
1011
|
+
|
1012
|
+
<span class="summary_desc"><div class='inline'>
|
1013
|
+
<p>set the <code>type</code> to :rock, the <code>icon</code> to <tt>██</tt>, the
|
1014
|
+
<code>color</code> to color: WHITE, the <code>age</code> to and flags the
|
1015
|
+
tile to be updated by the <code>Console</code> attr_type, rock, ██, color:
|
1016
|
+
WHITE, , , ,.</p>
|
1017
|
+
</div></span>
|
1018
|
+
|
1019
|
+
</li>
|
1020
|
+
|
1021
|
+
|
1022
|
+
<li class="public ">
|
1023
|
+
<span class="summary_signature">
|
1024
|
+
|
1025
|
+
<a href="#rock!-instance_method" title="#rock! (instance method)">#<strong>rock!</strong> ⇒ true </a>
|
1026
|
+
|
1027
|
+
|
1028
|
+
|
1029
|
+
</span>
|
1030
|
+
|
1031
|
+
|
1032
|
+
|
1033
|
+
|
1034
|
+
|
1035
|
+
|
1036
|
+
|
1037
|
+
|
1038
|
+
|
1039
|
+
<span class="summary_desc"><div class='inline'>
|
1040
|
+
<p>set the <code>type</code> to :rock, the <code>icon</code> to '██',
|
1041
|
+
the <code>color</code> to color: WHITE, the <code>age</code> to 0, and
|
1042
|
+
flags the tile to be updated by the <code>Console</code>.</p>
|
1043
|
+
</div></span>
|
1044
|
+
|
1045
|
+
</li>
|
1046
|
+
|
1047
|
+
|
1048
|
+
<li class="public ">
|
1049
|
+
<span class="summary_signature">
|
1050
|
+
|
1051
|
+
<a href="#rock%3F-instance_method" title="#rock? (instance method)">#<strong>rock?</strong> ⇒ Boolean </a>
|
1052
|
+
|
1053
|
+
|
1054
|
+
|
1055
|
+
</span>
|
1056
|
+
|
1057
|
+
|
1058
|
+
|
1059
|
+
|
1060
|
+
|
1061
|
+
|
1062
|
+
|
1063
|
+
|
1064
|
+
|
1065
|
+
<span class="summary_desc"><div class='inline'>
|
1066
|
+
<p>test the value of <code>type</code>.</p>
|
1067
|
+
</div></span>
|
1068
|
+
|
1069
|
+
</li>
|
1070
|
+
|
1071
|
+
|
1072
|
+
<li class="public ">
|
1073
|
+
<span class="summary_signature">
|
1074
|
+
|
1075
|
+
<a href="#soldier-instance_method" title="#soldier (instance method)">#<strong>soldier</strong> ⇒ true </a>
|
1076
|
+
|
1077
|
+
|
1078
|
+
|
1079
|
+
</span>
|
1080
|
+
|
1081
|
+
|
1082
|
+
|
1083
|
+
|
1084
|
+
|
1085
|
+
|
1086
|
+
|
1087
|
+
|
1088
|
+
|
1089
|
+
<span class="summary_desc"><div class='inline'>
|
1090
|
+
<p>set the <code>type</code> to :soldier, the <code>icon</code> to <tt>╟╢</tt>, the
|
1091
|
+
<code>color</code> to color: RED, the <code>age</code> to and flags the
|
1092
|
+
tile to be updated by the <code>Console</code> attr_type, soldier, ╟╢,
|
1093
|
+
color: RED, , , ,.</p>
|
1094
|
+
</div></span>
|
1095
|
+
|
1096
|
+
</li>
|
1097
|
+
|
1098
|
+
|
1099
|
+
<li class="public ">
|
1100
|
+
<span class="summary_signature">
|
1101
|
+
|
1102
|
+
<a href="#soldier!-instance_method" title="#soldier! (instance method)">#<strong>soldier!</strong> ⇒ true </a>
|
1103
|
+
|
1104
|
+
|
1105
|
+
|
1106
|
+
</span>
|
1107
|
+
|
1108
|
+
|
1109
|
+
|
1110
|
+
|
1111
|
+
|
1112
|
+
|
1113
|
+
|
1114
|
+
|
1115
|
+
|
1116
|
+
<span class="summary_desc"><div class='inline'>
|
1117
|
+
<p>set the <code>type</code> to :soldier, the <code>icon</code> to
|
1118
|
+
'╟╢', the <code>color</code> to color: RED, the <code>age</code> to
|
1119
|
+
0, and flags the tile to be updated by the <code>Console</code>.</p>
|
1120
|
+
</div></span>
|
1121
|
+
|
1122
|
+
</li>
|
1123
|
+
|
1124
|
+
|
1125
|
+
<li class="public ">
|
1126
|
+
<span class="summary_signature">
|
1127
|
+
|
1128
|
+
<a href="#soldier%3F-instance_method" title="#soldier? (instance method)">#<strong>soldier?</strong> ⇒ Boolean </a>
|
1129
|
+
|
1130
|
+
|
1131
|
+
|
1132
|
+
</span>
|
1133
|
+
|
1134
|
+
|
1135
|
+
|
1136
|
+
|
1137
|
+
|
1138
|
+
|
1139
|
+
|
1140
|
+
|
1141
|
+
|
1142
|
+
<span class="summary_desc"><div class='inline'>
|
1143
|
+
<p>test the value of <code>type</code>.</p>
|
1144
|
+
</div></span>
|
1145
|
+
|
1146
|
+
</li>
|
1147
|
+
|
1148
|
+
|
1149
|
+
<li class="public ">
|
1150
|
+
<span class="summary_signature">
|
1151
|
+
|
1152
|
+
<a href="#worker-instance_method" title="#worker (instance method)">#<strong>worker</strong> ⇒ true </a>
|
1153
|
+
|
1154
|
+
|
1155
|
+
|
1156
|
+
</span>
|
1157
|
+
|
1158
|
+
|
1159
|
+
|
1160
|
+
|
1161
|
+
|
1162
|
+
|
1163
|
+
|
1164
|
+
|
1165
|
+
|
1166
|
+
<span class="summary_desc"><div class='inline'>
|
1167
|
+
<p>set the <code>type</code> to :worker, the <code>icon</code> to <tt>├┤</tt>, the
|
1168
|
+
<code>color</code> to color: BLUE, the <code>age</code> to and flags the
|
1169
|
+
tile to be updated by the <code>Console</code> attr_type, worker, ├┤,
|
1170
|
+
color: BLUE, , , ,.</p>
|
1171
|
+
</div></span>
|
1172
|
+
|
1173
|
+
</li>
|
1174
|
+
|
1175
|
+
|
1176
|
+
<li class="public ">
|
1177
|
+
<span class="summary_signature">
|
1178
|
+
|
1179
|
+
<a href="#worker!-instance_method" title="#worker! (instance method)">#<strong>worker!</strong> ⇒ true </a>
|
1180
|
+
|
1181
|
+
|
1182
|
+
|
1183
|
+
</span>
|
1184
|
+
|
1185
|
+
|
1186
|
+
|
1187
|
+
|
1188
|
+
|
1189
|
+
|
1190
|
+
|
1191
|
+
|
1192
|
+
|
1193
|
+
<span class="summary_desc"><div class='inline'>
|
1194
|
+
<p>set the <code>type</code> to :worker, the <code>icon</code> to
|
1195
|
+
'├┤', the <code>color</code> to color: BLUE, the <code>age</code>
|
1196
|
+
to 0, and flags the tile to be updated by the <code>Console</code>.</p>
|
1197
|
+
</div></span>
|
1198
|
+
|
1199
|
+
</li>
|
1200
|
+
|
1201
|
+
|
1202
|
+
<li class="public ">
|
1203
|
+
<span class="summary_signature">
|
1204
|
+
|
1205
|
+
<a href="#worker%3F-instance_method" title="#worker? (instance method)">#<strong>worker?</strong> ⇒ Boolean </a>
|
1206
|
+
|
1207
|
+
|
1208
|
+
|
1209
|
+
</span>
|
1210
|
+
|
1211
|
+
|
1212
|
+
|
1213
|
+
|
1214
|
+
|
1215
|
+
|
1216
|
+
|
1217
|
+
|
1218
|
+
|
1219
|
+
<span class="summary_desc"><div class='inline'>
|
1220
|
+
<p>test the value of <code>type</code>.</p>
|
1221
|
+
</div></span>
|
1222
|
+
|
1223
|
+
</li>
|
1224
|
+
|
1225
|
+
|
1226
|
+
</ul>
|
1227
|
+
|
1228
|
+
|
1229
|
+
|
1230
|
+
|
1231
|
+
|
1232
|
+
|
1233
|
+
|
1234
|
+
|
1235
|
+
<div id="constructor_details" class="method_details_list">
|
1236
|
+
<h2>Constructor Details</h2>
|
1237
|
+
|
1238
|
+
<div class="method_details first">
|
1239
|
+
<h3 class="signature first" id="initialize-instance_method">
|
1240
|
+
|
1241
|
+
#<strong>initialize</strong>(map_x, map_y, location) ⇒ <tt><span class='object_link'><a href="" title="Swarm::Tile (class)">Tile</a></span></tt>
|
1242
|
+
|
1243
|
+
|
1244
|
+
|
1245
|
+
|
1246
|
+
|
1247
|
+
</h3><div class="docstring">
|
1248
|
+
<div class="discussion">
|
1249
|
+
|
1250
|
+
<p>Initialize a <code>Tile</code> with the <code>x</code> and both
|
1251
|
+
<code>y</code> positions (<code>Console</code> and <code>Map</code>) on the
|
1252
|
+
<code>Console</code>. Since tiles are 2 characters wide, two sets
|
1253
|
+
coordinates are stored: the position in the console (+@location+) and the
|
1254
|
+
position on the map (+@x+ and <tt>@y</tt>). All tiles start off as
|
1255
|
+
<code>:empty</code>.</p>
|
1256
|
+
|
1257
|
+
|
1258
|
+
</div>
|
1259
|
+
</div>
|
1260
|
+
<div class="tags">
|
1261
|
+
<p class="tag_title">Parameters:</p>
|
1262
|
+
<ul class="param">
|
1263
|
+
|
1264
|
+
<li>
|
1265
|
+
|
1266
|
+
<span class='name'>map_x</span>
|
1267
|
+
|
1268
|
+
|
1269
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1270
|
+
|
1271
|
+
|
1272
|
+
|
1273
|
+
</li>
|
1274
|
+
|
1275
|
+
<li>
|
1276
|
+
|
1277
|
+
<span class='name'>map_y</span>
|
1278
|
+
|
1279
|
+
|
1280
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1281
|
+
|
1282
|
+
|
1283
|
+
|
1284
|
+
</li>
|
1285
|
+
|
1286
|
+
<li>
|
1287
|
+
|
1288
|
+
<span class='name'>console_x</span>
|
1289
|
+
|
1290
|
+
|
1291
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1292
|
+
|
1293
|
+
|
1294
|
+
|
1295
|
+
—
|
1296
|
+
<div class='inline'>
|
1297
|
+
<p>default <code>x</code></p>
|
1298
|
+
</div>
|
1299
|
+
|
1300
|
+
</li>
|
1301
|
+
|
1302
|
+
<li>
|
1303
|
+
|
1304
|
+
<span class='name'>console_y</span>
|
1305
|
+
|
1306
|
+
|
1307
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1308
|
+
|
1309
|
+
|
1310
|
+
|
1311
|
+
—
|
1312
|
+
<div class='inline'>
|
1313
|
+
<p>default <code>y</code></p>
|
1314
|
+
</div>
|
1315
|
+
|
1316
|
+
</li>
|
1317
|
+
|
1318
|
+
</ul>
|
1319
|
+
|
1320
|
+
|
1321
|
+
</div><table class="source_code">
|
1322
|
+
<tr>
|
1323
|
+
<td>
|
1324
|
+
<pre class="lines">
|
1325
|
+
|
1326
|
+
|
1327
|
+
89
|
1328
|
+
90
|
1329
|
+
91
|
1330
|
+
92
|
1331
|
+
93
|
1332
|
+
94</pre>
|
1333
|
+
</td>
|
1334
|
+
<td>
|
1335
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 89</span>
|
1336
|
+
|
1337
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_map_x'>map_x</span><span class='comma'>,</span> <span class='id identifier rubyid_map_y'>map_y</span><span class='comma'>,</span> <span class='id identifier rubyid_location'>location</span><span class='rparen'>)</span>
|
1338
|
+
<span class='ivar'>@location</span> <span class='op'>=</span> <span class='id identifier rubyid_location'>location</span>
|
1339
|
+
<span class='ivar'>@x</span> <span class='op'>=</span> <span class='id identifier rubyid_map_x'>map_x</span>
|
1340
|
+
<span class='ivar'>@y</span> <span class='op'>=</span> <span class='id identifier rubyid_map_y'>map_y</span>
|
1341
|
+
<span class='ivar'>@age</span> <span class='op'>=</span> <span class='int'>0</span>
|
1342
|
+
<span class='kw'>end</span></pre>
|
1343
|
+
</td>
|
1344
|
+
</tr>
|
1345
|
+
</table>
|
1346
|
+
</div>
|
1347
|
+
|
1348
|
+
</div>
|
1349
|
+
|
1350
|
+
<div id="instance_attr_details" class="attr_details">
|
1351
|
+
<h2>Instance Attribute Details</h2>
|
1352
|
+
|
1353
|
+
|
1354
|
+
<span id=""></span>
|
1355
|
+
<div class="method_details first">
|
1356
|
+
<h3 class="signature first" id="age-instance_method">
|
1357
|
+
|
1358
|
+
#<strong>age</strong> ⇒ <tt>Integer</tt> <span class="extras">(readonly)</span>
|
1359
|
+
|
1360
|
+
|
1361
|
+
|
1362
|
+
|
1363
|
+
|
1364
|
+
</h3><div class="docstring">
|
1365
|
+
<div class="discussion">
|
1366
|
+
|
1367
|
+
|
1368
|
+
</div>
|
1369
|
+
</div>
|
1370
|
+
<div class="tags">
|
1371
|
+
|
1372
|
+
<p class="tag_title">Returns:</p>
|
1373
|
+
<ul class="return">
|
1374
|
+
|
1375
|
+
<li>
|
1376
|
+
|
1377
|
+
|
1378
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1379
|
+
|
1380
|
+
|
1381
|
+
|
1382
|
+
</li>
|
1383
|
+
|
1384
|
+
</ul>
|
1385
|
+
|
1386
|
+
</div><table class="source_code">
|
1387
|
+
<tr>
|
1388
|
+
<td>
|
1389
|
+
<pre class="lines">
|
1390
|
+
|
1391
|
+
|
1392
|
+
78
|
1393
|
+
79
|
1394
|
+
80</pre>
|
1395
|
+
</td>
|
1396
|
+
<td>
|
1397
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 78</span>
|
1398
|
+
|
1399
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_age'>age</span>
|
1400
|
+
<span class='ivar'>@age</span>
|
1401
|
+
<span class='kw'>end</span></pre>
|
1402
|
+
</td>
|
1403
|
+
</tr>
|
1404
|
+
</table>
|
1405
|
+
</div>
|
1406
|
+
|
1407
|
+
|
1408
|
+
<span id=""></span>
|
1409
|
+
<div class="method_details ">
|
1410
|
+
<h3 class="signature " id="color-instance_method">
|
1411
|
+
|
1412
|
+
#<strong>color</strong> ⇒ <tt>Integer</tt> <span class="extras">(readonly)</span>
|
1413
|
+
|
1414
|
+
|
1415
|
+
|
1416
|
+
|
1417
|
+
|
1418
|
+
</h3><div class="docstring">
|
1419
|
+
<div class="discussion">
|
1420
|
+
|
1421
|
+
|
1422
|
+
</div>
|
1423
|
+
</div>
|
1424
|
+
<div class="tags">
|
1425
|
+
|
1426
|
+
<p class="tag_title">Returns:</p>
|
1427
|
+
<ul class="return">
|
1428
|
+
|
1429
|
+
<li>
|
1430
|
+
|
1431
|
+
|
1432
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1433
|
+
|
1434
|
+
|
1435
|
+
|
1436
|
+
</li>
|
1437
|
+
|
1438
|
+
</ul>
|
1439
|
+
|
1440
|
+
</div><table class="source_code">
|
1441
|
+
<tr>
|
1442
|
+
<td>
|
1443
|
+
<pre class="lines">
|
1444
|
+
|
1445
|
+
|
1446
|
+
73
|
1447
|
+
74
|
1448
|
+
75</pre>
|
1449
|
+
</td>
|
1450
|
+
<td>
|
1451
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 73</span>
|
1452
|
+
|
1453
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_color'>color</span>
|
1454
|
+
<span class='ivar'>@color</span>
|
1455
|
+
<span class='kw'>end</span></pre>
|
1456
|
+
</td>
|
1457
|
+
</tr>
|
1458
|
+
</table>
|
1459
|
+
</div>
|
1460
|
+
|
1461
|
+
|
1462
|
+
<span id=""></span>
|
1463
|
+
<div class="method_details ">
|
1464
|
+
<h3 class="signature " id="icon-instance_method">
|
1465
|
+
|
1466
|
+
#<strong>icon</strong> ⇒ <tt>String</tt> <span class="extras">(readonly)</span>
|
1467
|
+
|
1468
|
+
|
1469
|
+
|
1470
|
+
|
1471
|
+
|
1472
|
+
</h3><div class="docstring">
|
1473
|
+
<div class="discussion">
|
1474
|
+
|
1475
|
+
|
1476
|
+
</div>
|
1477
|
+
</div>
|
1478
|
+
<div class="tags">
|
1479
|
+
|
1480
|
+
<p class="tag_title">Returns:</p>
|
1481
|
+
<ul class="return">
|
1482
|
+
|
1483
|
+
<li>
|
1484
|
+
|
1485
|
+
|
1486
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1487
|
+
|
1488
|
+
|
1489
|
+
|
1490
|
+
</li>
|
1491
|
+
|
1492
|
+
</ul>
|
1493
|
+
|
1494
|
+
</div><table class="source_code">
|
1495
|
+
<tr>
|
1496
|
+
<td>
|
1497
|
+
<pre class="lines">
|
1498
|
+
|
1499
|
+
|
1500
|
+
70
|
1501
|
+
71
|
1502
|
+
72</pre>
|
1503
|
+
</td>
|
1504
|
+
<td>
|
1505
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 70</span>
|
1506
|
+
|
1507
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_icon'>icon</span>
|
1508
|
+
<span class='ivar'>@icon</span>
|
1509
|
+
<span class='kw'>end</span></pre>
|
1510
|
+
</td>
|
1511
|
+
</tr>
|
1512
|
+
</table>
|
1513
|
+
</div>
|
1514
|
+
|
1515
|
+
|
1516
|
+
<span id=""></span>
|
1517
|
+
<div class="method_details ">
|
1518
|
+
<h3 class="signature " id="location-instance_method">
|
1519
|
+
|
1520
|
+
#<strong>location</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
1521
|
+
|
1522
|
+
|
1523
|
+
|
1524
|
+
|
1525
|
+
|
1526
|
+
</h3><div class="docstring">
|
1527
|
+
<div class="discussion">
|
1528
|
+
|
1529
|
+
<p>Returns the value of attribute location</p>
|
1530
|
+
|
1531
|
+
|
1532
|
+
</div>
|
1533
|
+
</div>
|
1534
|
+
<div class="tags">
|
1535
|
+
|
1536
|
+
|
1537
|
+
</div><table class="source_code">
|
1538
|
+
<tr>
|
1539
|
+
<td>
|
1540
|
+
<pre class="lines">
|
1541
|
+
|
1542
|
+
|
1543
|
+
75
|
1544
|
+
76
|
1545
|
+
77</pre>
|
1546
|
+
</td>
|
1547
|
+
<td>
|
1548
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 75</span>
|
1549
|
+
|
1550
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_location'>location</span>
|
1551
|
+
<span class='ivar'>@location</span>
|
1552
|
+
<span class='kw'>end</span></pre>
|
1553
|
+
</td>
|
1554
|
+
</tr>
|
1555
|
+
</table>
|
1556
|
+
</div>
|
1557
|
+
|
1558
|
+
|
1559
|
+
<span id=""></span>
|
1560
|
+
<div class="method_details ">
|
1561
|
+
<h3 class="signature " id="type-instance_method">
|
1562
|
+
|
1563
|
+
#<strong>type</strong> ⇒ <tt>Symbol</tt> <span class="extras">(readonly)</span>
|
1564
|
+
|
1565
|
+
|
1566
|
+
|
1567
|
+
|
1568
|
+
|
1569
|
+
</h3><div class="docstring">
|
1570
|
+
<div class="discussion">
|
1571
|
+
|
1572
|
+
|
1573
|
+
</div>
|
1574
|
+
</div>
|
1575
|
+
<div class="tags">
|
1576
|
+
|
1577
|
+
<p class="tag_title">Returns:</p>
|
1578
|
+
<ul class="return">
|
1579
|
+
|
1580
|
+
<li>
|
1581
|
+
|
1582
|
+
|
1583
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
1584
|
+
|
1585
|
+
|
1586
|
+
|
1587
|
+
</li>
|
1588
|
+
|
1589
|
+
</ul>
|
1590
|
+
|
1591
|
+
</div><table class="source_code">
|
1592
|
+
<tr>
|
1593
|
+
<td>
|
1594
|
+
<pre class="lines">
|
1595
|
+
|
1596
|
+
|
1597
|
+
67
|
1598
|
+
68
|
1599
|
+
69</pre>
|
1600
|
+
</td>
|
1601
|
+
<td>
|
1602
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 67</span>
|
1603
|
+
|
1604
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
|
1605
|
+
<span class='ivar'>@type</span>
|
1606
|
+
<span class='kw'>end</span></pre>
|
1607
|
+
</td>
|
1608
|
+
</tr>
|
1609
|
+
</table>
|
1610
|
+
</div>
|
1611
|
+
|
1612
|
+
|
1613
|
+
<span id=""></span>
|
1614
|
+
<div class="method_details ">
|
1615
|
+
<h3 class="signature " id="x-instance_method">
|
1616
|
+
|
1617
|
+
#<strong>x</strong> ⇒ <tt>Integer</tt> <span class="extras">(readonly)</span>
|
1618
|
+
|
1619
|
+
|
1620
|
+
|
1621
|
+
|
1622
|
+
|
1623
|
+
</h3><div class="docstring">
|
1624
|
+
<div class="discussion">
|
1625
|
+
|
1626
|
+
<p>Returns the position of the <code>tile</code> on the x axis.</p>
|
1627
|
+
|
1628
|
+
|
1629
|
+
</div>
|
1630
|
+
</div>
|
1631
|
+
<div class="tags">
|
1632
|
+
|
1633
|
+
<p class="tag_title">Returns:</p>
|
1634
|
+
<ul class="return">
|
1635
|
+
|
1636
|
+
<li>
|
1637
|
+
|
1638
|
+
|
1639
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1640
|
+
|
1641
|
+
|
1642
|
+
|
1643
|
+
—
|
1644
|
+
<div class='inline'>
|
1645
|
+
<p>the position of the <code>tile</code> on the x axis.</p>
|
1646
|
+
</div>
|
1647
|
+
|
1648
|
+
</li>
|
1649
|
+
|
1650
|
+
</ul>
|
1651
|
+
|
1652
|
+
</div><table class="source_code">
|
1653
|
+
<tr>
|
1654
|
+
<td>
|
1655
|
+
<pre class="lines">
|
1656
|
+
|
1657
|
+
|
1658
|
+
61
|
1659
|
+
62
|
1660
|
+
63</pre>
|
1661
|
+
</td>
|
1662
|
+
<td>
|
1663
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 61</span>
|
1664
|
+
|
1665
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_x'>x</span>
|
1666
|
+
<span class='ivar'>@x</span>
|
1667
|
+
<span class='kw'>end</span></pre>
|
1668
|
+
</td>
|
1669
|
+
</tr>
|
1670
|
+
</table>
|
1671
|
+
</div>
|
1672
|
+
|
1673
|
+
|
1674
|
+
<span id=""></span>
|
1675
|
+
<div class="method_details ">
|
1676
|
+
<h3 class="signature " id="y-instance_method">
|
1677
|
+
|
1678
|
+
#<strong>y</strong> ⇒ <tt>Integer</tt> <span class="extras">(readonly)</span>
|
1679
|
+
|
1680
|
+
|
1681
|
+
|
1682
|
+
|
1683
|
+
|
1684
|
+
</h3><div class="docstring">
|
1685
|
+
<div class="discussion">
|
1686
|
+
|
1687
|
+
<p>Returns the position of the <code>tile</code> on the y axis.</p>
|
1688
|
+
|
1689
|
+
|
1690
|
+
</div>
|
1691
|
+
</div>
|
1692
|
+
<div class="tags">
|
1693
|
+
|
1694
|
+
<p class="tag_title">Returns:</p>
|
1695
|
+
<ul class="return">
|
1696
|
+
|
1697
|
+
<li>
|
1698
|
+
|
1699
|
+
|
1700
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1701
|
+
|
1702
|
+
|
1703
|
+
|
1704
|
+
—
|
1705
|
+
<div class='inline'>
|
1706
|
+
<p>the position of the <code>tile</code> on the y axis.</p>
|
1707
|
+
</div>
|
1708
|
+
|
1709
|
+
</li>
|
1710
|
+
|
1711
|
+
</ul>
|
1712
|
+
|
1713
|
+
</div><table class="source_code">
|
1714
|
+
<tr>
|
1715
|
+
<td>
|
1716
|
+
<pre class="lines">
|
1717
|
+
|
1718
|
+
|
1719
|
+
64
|
1720
|
+
65
|
1721
|
+
66</pre>
|
1722
|
+
</td>
|
1723
|
+
<td>
|
1724
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 64</span>
|
1725
|
+
|
1726
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_y'>y</span>
|
1727
|
+
<span class='ivar'>@y</span>
|
1728
|
+
<span class='kw'>end</span></pre>
|
1729
|
+
</td>
|
1730
|
+
</tr>
|
1731
|
+
</table>
|
1732
|
+
</div>
|
1733
|
+
|
1734
|
+
</div>
|
1735
|
+
|
1736
|
+
|
1737
|
+
<div id="class_method_details" class="method_details_list">
|
1738
|
+
<h2>Class Method Details</h2>
|
1739
|
+
|
1740
|
+
|
1741
|
+
<div class="method_details first">
|
1742
|
+
<h3 class="signature first" id="attr_type-class_method">
|
1743
|
+
|
1744
|
+
.<strong>attr_type</strong>(type, icon: String.new, color: 0) ⇒ <tt>Object</tt>
|
1745
|
+
|
1746
|
+
|
1747
|
+
|
1748
|
+
|
1749
|
+
|
1750
|
+
</h3><div class="docstring">
|
1751
|
+
<div class="discussion">
|
1752
|
+
|
1753
|
+
<p>Create methods for setting and testing the <code>type</code> value, change
|
1754
|
+
status and console color of every <code>Tile</code>.</p>
|
1755
|
+
|
1756
|
+
|
1757
|
+
</div>
|
1758
|
+
</div>
|
1759
|
+
<div class="tags">
|
1760
|
+
|
1761
|
+
|
1762
|
+
</div><table class="source_code">
|
1763
|
+
<tr>
|
1764
|
+
<td>
|
1765
|
+
<pre class="lines">
|
1766
|
+
|
1767
|
+
|
1768
|
+
28
|
1769
|
+
29
|
1770
|
+
30
|
1771
|
+
31
|
1772
|
+
32
|
1773
|
+
33
|
1774
|
+
34
|
1775
|
+
35
|
1776
|
+
36
|
1777
|
+
37
|
1778
|
+
38
|
1779
|
+
39
|
1780
|
+
40
|
1781
|
+
41
|
1782
|
+
42
|
1783
|
+
43</pre>
|
1784
|
+
</td>
|
1785
|
+
<td>
|
1786
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 28</span>
|
1787
|
+
|
1788
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_attr_type'>attr_type</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='const'>String</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='int'>0</span><span class='rparen'>)</span>
|
1789
|
+
<span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_age'>age</span><span class='op'>|</span>
|
1790
|
+
<span class='id identifier rubyid_change'>change</span> <span class='kw'>do</span>
|
1791
|
+
<span class='ivar'>@type</span> <span class='op'>=</span> <span class='id identifier rubyid_type'>type</span>
|
1792
|
+
<span class='ivar'>@icon</span> <span class='op'>=</span> <span class='id identifier rubyid_icon'>icon</span>
|
1793
|
+
<span class='ivar'>@color</span> <span class='op'>=</span> <span class='id identifier rubyid_color'>color</span>
|
1794
|
+
<span class='ivar'>@age</span> <span class='op'>=</span> <span class='id identifier rubyid_age'>age</span>
|
1795
|
+
<span class='kw'>end</span>
|
1796
|
+
|
1797
|
+
<span class='kw'>self</span>
|
1798
|
+
<span class='kw'>end</span>
|
1799
|
+
|
1800
|
+
<span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'>!</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_send'>send</span> <span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='int'>0</span> <span class='rbrace'>}</span>
|
1801
|
+
|
1802
|
+
<span class='id identifier rubyid_define_method'>define_method</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type'>type</span><span class='embexpr_end'>}</span><span class='tstring_content'>?</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='ivar'>@type</span> <span class='op'>==</span> <span class='id identifier rubyid_type'>type</span> <span class='rbrace'>}</span>
|
1803
|
+
<span class='kw'>end</span></pre>
|
1804
|
+
</td>
|
1805
|
+
</tr>
|
1806
|
+
</table>
|
1807
|
+
</div>
|
1808
|
+
|
1809
|
+
</div>
|
1810
|
+
|
1811
|
+
<div id="instance_method_details" class="method_details_list">
|
1812
|
+
<h2>Instance Method Details</h2>
|
1813
|
+
|
1814
|
+
|
1815
|
+
<div class="method_details first">
|
1816
|
+
<h3 class="signature first" id="===-instance_method">
|
1817
|
+
|
1818
|
+
#<strong>===</strong>(other) ⇒ <tt>Boolean</tt>
|
1819
|
+
|
1820
|
+
|
1821
|
+
|
1822
|
+
|
1823
|
+
|
1824
|
+
</h3><div class="docstring">
|
1825
|
+
<div class="discussion">
|
1826
|
+
|
1827
|
+
|
1828
|
+
</div>
|
1829
|
+
</div>
|
1830
|
+
<div class="tags">
|
1831
|
+
|
1832
|
+
<p class="tag_title">Returns:</p>
|
1833
|
+
<ul class="return">
|
1834
|
+
|
1835
|
+
<li>
|
1836
|
+
|
1837
|
+
|
1838
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1839
|
+
|
1840
|
+
|
1841
|
+
|
1842
|
+
</li>
|
1843
|
+
|
1844
|
+
</ul>
|
1845
|
+
|
1846
|
+
</div><table class="source_code">
|
1847
|
+
<tr>
|
1848
|
+
<td>
|
1849
|
+
<pre class="lines">
|
1850
|
+
|
1851
|
+
|
1852
|
+
101
|
1853
|
+
102
|
1854
|
+
103</pre>
|
1855
|
+
</td>
|
1856
|
+
<td>
|
1857
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 101</span>
|
1858
|
+
|
1859
|
+
<span class='kw'>def</span> <span class='op'>===</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
|
1860
|
+
<span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span>
|
1861
|
+
<span class='kw'>end</span></pre>
|
1862
|
+
</td>
|
1863
|
+
</tr>
|
1864
|
+
</table>
|
1865
|
+
</div>
|
1866
|
+
|
1867
|
+
<div class="method_details ">
|
1868
|
+
<h3 class="signature " id="age!-instance_method">
|
1869
|
+
|
1870
|
+
#<strong>age!</strong> ⇒ <tt>Integer</tt>
|
1871
|
+
|
1872
|
+
|
1873
|
+
|
1874
|
+
|
1875
|
+
|
1876
|
+
</h3><div class="docstring">
|
1877
|
+
<div class="discussion">
|
1878
|
+
|
1879
|
+
|
1880
|
+
</div>
|
1881
|
+
</div>
|
1882
|
+
<div class="tags">
|
1883
|
+
|
1884
|
+
<p class="tag_title">Returns:</p>
|
1885
|
+
<ul class="return">
|
1886
|
+
|
1887
|
+
<li>
|
1888
|
+
|
1889
|
+
|
1890
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1891
|
+
|
1892
|
+
|
1893
|
+
|
1894
|
+
</li>
|
1895
|
+
|
1896
|
+
</ul>
|
1897
|
+
|
1898
|
+
</div><table class="source_code">
|
1899
|
+
<tr>
|
1900
|
+
<td>
|
1901
|
+
<pre class="lines">
|
1902
|
+
|
1903
|
+
|
1904
|
+
111
|
1905
|
+
112
|
1906
|
+
113</pre>
|
1907
|
+
</td>
|
1908
|
+
<td>
|
1909
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 111</span>
|
1910
|
+
|
1911
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_age!'>age!</span>
|
1912
|
+
<span class='ivar'>@age</span> <span class='op'>+=</span> <span class='int'>1</span>
|
1913
|
+
<span class='kw'>end</span></pre>
|
1914
|
+
</td>
|
1915
|
+
</tr>
|
1916
|
+
</table>
|
1917
|
+
</div>
|
1918
|
+
|
1919
|
+
<div class="method_details ">
|
1920
|
+
<h3 class="signature " id="born!-instance_method">
|
1921
|
+
|
1922
|
+
#<strong>born!</strong> ⇒ <tt>Integer</tt>
|
1923
|
+
|
1924
|
+
|
1925
|
+
|
1926
|
+
|
1927
|
+
|
1928
|
+
</h3><div class="docstring">
|
1929
|
+
<div class="discussion">
|
1930
|
+
|
1931
|
+
|
1932
|
+
</div>
|
1933
|
+
</div>
|
1934
|
+
<div class="tags">
|
1935
|
+
|
1936
|
+
<p class="tag_title">Returns:</p>
|
1937
|
+
<ul class="return">
|
1938
|
+
|
1939
|
+
<li>
|
1940
|
+
|
1941
|
+
|
1942
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1943
|
+
|
1944
|
+
|
1945
|
+
|
1946
|
+
</li>
|
1947
|
+
|
1948
|
+
</ul>
|
1949
|
+
|
1950
|
+
</div><table class="source_code">
|
1951
|
+
<tr>
|
1952
|
+
<td>
|
1953
|
+
<pre class="lines">
|
1954
|
+
|
1955
|
+
|
1956
|
+
106
|
1957
|
+
107
|
1958
|
+
108</pre>
|
1959
|
+
</td>
|
1960
|
+
<td>
|
1961
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 106</span>
|
1962
|
+
|
1963
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_born!'>born!</span>
|
1964
|
+
<span class='ivar'>@age</span> <span class='op'>=</span> <span class='int'>0</span>
|
1965
|
+
<span class='kw'>end</span></pre>
|
1966
|
+
</td>
|
1967
|
+
</tr>
|
1968
|
+
</table>
|
1969
|
+
</div>
|
1970
|
+
|
1971
|
+
<div class="method_details ">
|
1972
|
+
<h3 class="signature " id="change-instance_method">
|
1973
|
+
|
1974
|
+
#<strong>change</strong> ⇒ <tt>Void</tt>
|
1975
|
+
|
1976
|
+
|
1977
|
+
|
1978
|
+
|
1979
|
+
|
1980
|
+
</h3><div class="docstring">
|
1981
|
+
<div class="discussion">
|
1982
|
+
|
1983
|
+
|
1984
|
+
</div>
|
1985
|
+
</div>
|
1986
|
+
<div class="tags">
|
1987
|
+
|
1988
|
+
<p class="tag_title">Returns:</p>
|
1989
|
+
<ul class="return">
|
1990
|
+
|
1991
|
+
<li>
|
1992
|
+
|
1993
|
+
|
1994
|
+
<span class='type'>(<tt>Void</tt>)</span>
|
1995
|
+
|
1996
|
+
|
1997
|
+
|
1998
|
+
</li>
|
1999
|
+
|
2000
|
+
</ul>
|
2001
|
+
|
2002
|
+
</div><table class="source_code">
|
2003
|
+
<tr>
|
2004
|
+
<td>
|
2005
|
+
<pre class="lines">
|
2006
|
+
|
2007
|
+
|
2008
|
+
126
|
2009
|
+
127
|
2010
|
+
128
|
2011
|
+
129
|
2012
|
+
130
|
2013
|
+
131
|
2014
|
+
132
|
2015
|
+
133</pre>
|
2016
|
+
</td>
|
2017
|
+
<td>
|
2018
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 126</span>
|
2019
|
+
|
2020
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_change'>change</span>
|
2021
|
+
<span class='const'><span class='object_link'><a href="Catalog.html" title="Swarm::Catalog (class)">Catalog</a></span></span><span class='period'>.</span><span class='id identifier rubyid_delete'><span class='object_link'><a href="Catalog.html#delete-class_method" title="Swarm::Catalog.delete (method)">delete</a></span></span> <span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='kw'>self</span>
|
2022
|
+
|
2023
|
+
<span class='kw'>yield</span>
|
2024
|
+
|
2025
|
+
<span class='const'><span class='object_link'><a href="Catalog.html" title="Swarm::Catalog (class)">Catalog</a></span></span><span class='period'>.</span><span class='id identifier rubyid_store'><span class='object_link'><a href="Catalog.html#store-class_method" title="Swarm::Catalog.store (method)">store</a></span></span> <span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='kw'>self</span>
|
2026
|
+
<span class='const'><span class='object_link'><a href="Catalog.html" title="Swarm::Catalog (class)">Catalog</a></span></span><span class='period'>.</span><span class='id identifier rubyid_store'><span class='object_link'><a href="Catalog.html#store-class_method" title="Swarm::Catalog.store (method)">store</a></span></span> <span class='symbol'>:changed</span><span class='comma'>,</span> <span class='kw'>self</span>
|
2027
|
+
<span class='kw'>end</span></pre>
|
2028
|
+
</td>
|
2029
|
+
</tr>
|
2030
|
+
</table>
|
2031
|
+
</div>
|
2032
|
+
|
2033
|
+
<div class="method_details ">
|
2034
|
+
<h3 class="signature " id="change!-instance_method">
|
2035
|
+
|
2036
|
+
#<strong>change!</strong> ⇒ <tt>Object</tt>
|
2037
|
+
|
2038
|
+
|
2039
|
+
|
2040
|
+
|
2041
|
+
|
2042
|
+
</h3><table class="source_code">
|
2043
|
+
<tr>
|
2044
|
+
<td>
|
2045
|
+
<pre class="lines">
|
2046
|
+
|
2047
|
+
|
2048
|
+
139
|
2049
|
+
140
|
2050
|
+
141</pre>
|
2051
|
+
</td>
|
2052
|
+
<td>
|
2053
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 139</span>
|
2054
|
+
|
2055
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_change!'>change!</span>
|
2056
|
+
<span class='const'><span class='object_link'><a href="Catalog.html" title="Swarm::Catalog (class)">Catalog</a></span></span><span class='period'>.</span><span class='id identifier rubyid_store'><span class='object_link'><a href="Catalog.html#store-class_method" title="Swarm::Catalog.store (method)">store</a></span></span> <span class='symbol'>:changed</span><span class='comma'>,</span> <span class='kw'>self</span>
|
2057
|
+
<span class='kw'>end</span></pre>
|
2058
|
+
</td>
|
2059
|
+
</tr>
|
2060
|
+
</table>
|
2061
|
+
</div>
|
2062
|
+
|
2063
|
+
<div class="method_details ">
|
2064
|
+
<h3 class="signature " id="changed?-instance_method">
|
2065
|
+
|
2066
|
+
#<strong>changed?</strong> ⇒ <tt>Boolean</tt>
|
2067
|
+
|
2068
|
+
|
2069
|
+
|
2070
|
+
|
2071
|
+
|
2072
|
+
</h3><div class="docstring">
|
2073
|
+
<div class="discussion">
|
2074
|
+
|
2075
|
+
|
2076
|
+
</div>
|
2077
|
+
</div>
|
2078
|
+
<div class="tags">
|
2079
|
+
|
2080
|
+
<p class="tag_title">Returns:</p>
|
2081
|
+
<ul class="return">
|
2082
|
+
|
2083
|
+
<li>
|
2084
|
+
|
2085
|
+
|
2086
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
2087
|
+
|
2088
|
+
|
2089
|
+
|
2090
|
+
</li>
|
2091
|
+
|
2092
|
+
</ul>
|
2093
|
+
|
2094
|
+
</div><table class="source_code">
|
2095
|
+
<tr>
|
2096
|
+
<td>
|
2097
|
+
<pre class="lines">
|
2098
|
+
|
2099
|
+
|
2100
|
+
135
|
2101
|
+
136
|
2102
|
+
137</pre>
|
2103
|
+
</td>
|
2104
|
+
<td>
|
2105
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 135</span>
|
2106
|
+
|
2107
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_changed?'>changed?</span>
|
2108
|
+
<span class='const'><span class='object_link'><a href="Catalog.html" title="Swarm::Catalog (class)">Catalog</a></span></span><span class='period'>.</span><span class='id identifier rubyid_fetch'><span class='object_link'><a href="Catalog.html#fetch-class_method" title="Swarm::Catalog.fetch (method)">fetch</a></span></span> <span class='symbol'>:changed</span><span class='comma'>,</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='kw'>false</span>
|
2109
|
+
<span class='kw'>end</span></pre>
|
2110
|
+
</td>
|
2111
|
+
</tr>
|
2112
|
+
</table>
|
2113
|
+
</div>
|
2114
|
+
|
2115
|
+
<div class="method_details ">
|
2116
|
+
<h3 class="signature " id="destroy!-instance_method">
|
2117
|
+
|
2118
|
+
#<strong>destroy!</strong> ⇒ <tt>Object</tt>
|
2119
|
+
|
2120
|
+
|
2121
|
+
|
2122
|
+
|
2123
|
+
|
2124
|
+
</h3><table class="source_code">
|
2125
|
+
<tr>
|
2126
|
+
<td>
|
2127
|
+
<pre class="lines">
|
2128
|
+
|
2129
|
+
|
2130
|
+
143
|
2131
|
+
144
|
2132
|
+
145
|
2133
|
+
146
|
2134
|
+
147</pre>
|
2135
|
+
</td>
|
2136
|
+
<td>
|
2137
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 143</span>
|
2138
|
+
|
2139
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_destroy!'>destroy!</span>
|
2140
|
+
<span class='const'><span class='object_link'><a href="Catalog.html" title="Swarm::Catalog (class)">Catalog</a></span></span><span class='period'>.</span><span class='id identifier rubyid_increment'><span class='object_link'><a href="Catalog.html#increment-class_method" title="Swarm::Catalog.increment (method)">increment</a></span></span> <span class='symbol'>:destroyed</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span>
|
2141
|
+
|
2142
|
+
<span class='id identifier rubyid_empty!'>empty!</span>
|
2143
|
+
<span class='kw'>end</span></pre>
|
2144
|
+
</td>
|
2145
|
+
</tr>
|
2146
|
+
</table>
|
2147
|
+
</div>
|
2148
|
+
|
2149
|
+
<div class="method_details ">
|
2150
|
+
<h3 class="signature " id="dirt-instance_method">
|
2151
|
+
|
2152
|
+
#<strong>dirt</strong> ⇒ <tt>true</tt>
|
2153
|
+
|
2154
|
+
|
2155
|
+
|
2156
|
+
|
2157
|
+
|
2158
|
+
</h3><div class="docstring">
|
2159
|
+
<div class="discussion">
|
2160
|
+
|
2161
|
+
<p>set the <code>type</code> to :dirt, the <code>icon</code> to <tt>██</tt>, the
|
2162
|
+
<code>color</code> to color: SILVER, the <code>age</code> to and flags the
|
2163
|
+
tile to be updated by the <code>Console</code> attr_type, dirt, ██, color:
|
2164
|
+
SILVER, , , ,</p>
|
2165
|
+
|
2166
|
+
|
2167
|
+
</div>
|
2168
|
+
</div>
|
2169
|
+
<div class="tags">
|
2170
|
+
<p class="tag_title">Parameters:</p>
|
2171
|
+
<ul class="param">
|
2172
|
+
|
2173
|
+
<li>
|
2174
|
+
|
2175
|
+
<span class='name'>age</span>
|
2176
|
+
|
2177
|
+
|
2178
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2179
|
+
|
2180
|
+
|
2181
|
+
|
2182
|
+
</li>
|
2183
|
+
|
2184
|
+
</ul>
|
2185
|
+
|
2186
|
+
<p class="tag_title">Returns:</p>
|
2187
|
+
<ul class="return">
|
2188
|
+
|
2189
|
+
<li>
|
2190
|
+
|
2191
|
+
|
2192
|
+
<span class='type'>(<tt>true</tt>)</span>
|
2193
|
+
|
2194
|
+
|
2195
|
+
|
2196
|
+
</li>
|
2197
|
+
|
2198
|
+
</ul>
|
2199
|
+
|
2200
|
+
</div><table class="source_code">
|
2201
|
+
<tr>
|
2202
|
+
<td>
|
2203
|
+
<pre class="lines">
|
2204
|
+
|
2205
|
+
|
2206
|
+
49</pre>
|
2207
|
+
</td>
|
2208
|
+
<td>
|
2209
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 49</span>
|
2210
|
+
|
2211
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:dirt</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>██</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#SILVER-constant" title="Swarm::Console::Color::SILVER (constant)">SILVER</a></span></span></pre>
|
2212
|
+
</td>
|
2213
|
+
</tr>
|
2214
|
+
</table>
|
2215
|
+
</div>
|
2216
|
+
|
2217
|
+
<div class="method_details ">
|
2218
|
+
<h3 class="signature " id="dirt!-instance_method">
|
2219
|
+
|
2220
|
+
#<strong>dirt!</strong> ⇒ <tt>true</tt>
|
2221
|
+
|
2222
|
+
|
2223
|
+
|
2224
|
+
|
2225
|
+
|
2226
|
+
</h3><div class="docstring">
|
2227
|
+
<div class="discussion">
|
2228
|
+
|
2229
|
+
<p>set the <code>type</code> to :dirt, the <code>icon</code> to '██',
|
2230
|
+
the <code>color</code> to color: SILVER, the <code>age</code> to 0, and
|
2231
|
+
flags the tile to be updated by the <code>Console</code></p>
|
2232
|
+
|
2233
|
+
|
2234
|
+
</div>
|
2235
|
+
</div>
|
2236
|
+
<div class="tags">
|
2237
|
+
<p class="tag_title">Parameters:</p>
|
2238
|
+
<ul class="param">
|
2239
|
+
|
2240
|
+
<li>
|
2241
|
+
|
2242
|
+
<span class='name'>age</span>
|
2243
|
+
|
2244
|
+
|
2245
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2246
|
+
|
2247
|
+
|
2248
|
+
|
2249
|
+
</li>
|
2250
|
+
|
2251
|
+
</ul>
|
2252
|
+
|
2253
|
+
<p class="tag_title">Returns:</p>
|
2254
|
+
<ul class="return">
|
2255
|
+
|
2256
|
+
<li>
|
2257
|
+
|
2258
|
+
|
2259
|
+
<span class='type'>(<tt>true</tt>)</span>
|
2260
|
+
|
2261
|
+
|
2262
|
+
|
2263
|
+
</li>
|
2264
|
+
|
2265
|
+
</ul>
|
2266
|
+
|
2267
|
+
</div><table class="source_code">
|
2268
|
+
<tr>
|
2269
|
+
<td>
|
2270
|
+
<pre class="lines">
|
2271
|
+
|
2272
|
+
|
2273
|
+
49</pre>
|
2274
|
+
</td>
|
2275
|
+
<td>
|
2276
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 49</span>
|
2277
|
+
|
2278
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:dirt</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>██</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#SILVER-constant" title="Swarm::Console::Color::SILVER (constant)">SILVER</a></span></span></pre>
|
2279
|
+
</td>
|
2280
|
+
</tr>
|
2281
|
+
</table>
|
2282
|
+
</div>
|
2283
|
+
|
2284
|
+
<div class="method_details ">
|
2285
|
+
<h3 class="signature " id="dirt?-instance_method">
|
2286
|
+
|
2287
|
+
#<strong>dirt?</strong> ⇒ <tt>Boolean</tt>
|
2288
|
+
|
2289
|
+
|
2290
|
+
|
2291
|
+
|
2292
|
+
|
2293
|
+
</h3><div class="docstring">
|
2294
|
+
<div class="discussion">
|
2295
|
+
|
2296
|
+
<p>test the value of <code>type</code></p>
|
2297
|
+
|
2298
|
+
|
2299
|
+
</div>
|
2300
|
+
</div>
|
2301
|
+
<div class="tags">
|
2302
|
+
|
2303
|
+
<p class="tag_title">Returns:</p>
|
2304
|
+
<ul class="return">
|
2305
|
+
|
2306
|
+
<li>
|
2307
|
+
|
2308
|
+
|
2309
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
2310
|
+
|
2311
|
+
|
2312
|
+
|
2313
|
+
—
|
2314
|
+
<div class='inline'>
|
2315
|
+
<p><code>true</code> if <code>type</code> is dirt, <code>false</code> if it is
|
2316
|
+
not</p>
|
2317
|
+
</div>
|
2318
|
+
|
2319
|
+
</li>
|
2320
|
+
|
2321
|
+
</ul>
|
2322
|
+
|
2323
|
+
</div><table class="source_code">
|
2324
|
+
<tr>
|
2325
|
+
<td>
|
2326
|
+
<pre class="lines">
|
2327
|
+
|
2328
|
+
|
2329
|
+
49</pre>
|
2330
|
+
</td>
|
2331
|
+
<td>
|
2332
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 49</span>
|
2333
|
+
|
2334
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:dirt</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>██</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#SILVER-constant" title="Swarm::Console::Color::SILVER (constant)">SILVER</a></span></span></pre>
|
2335
|
+
</td>
|
2336
|
+
</tr>
|
2337
|
+
</table>
|
2338
|
+
</div>
|
2339
|
+
|
2340
|
+
<div class="method_details ">
|
2341
|
+
<h3 class="signature " id="egg-instance_method">
|
2342
|
+
|
2343
|
+
#<strong>egg</strong> ⇒ <tt>true</tt>
|
2344
|
+
|
2345
|
+
|
2346
|
+
|
2347
|
+
|
2348
|
+
|
2349
|
+
</h3><div class="docstring">
|
2350
|
+
<div class="discussion">
|
2351
|
+
|
2352
|
+
<p>set the <code>type</code> to :egg, the <code>icon</code> to
|
2353
|
+
<code>oo</code>, the <code>color</code> to color: YELLOW, the
|
2354
|
+
<code>age</code> to and flags the tile to be updated by the
|
2355
|
+
<code>Console</code> attr_type, egg, oo, color: YELLOW, , , ,</p>
|
2356
|
+
|
2357
|
+
|
2358
|
+
</div>
|
2359
|
+
</div>
|
2360
|
+
<div class="tags">
|
2361
|
+
<p class="tag_title">Parameters:</p>
|
2362
|
+
<ul class="param">
|
2363
|
+
|
2364
|
+
<li>
|
2365
|
+
|
2366
|
+
<span class='name'>age</span>
|
2367
|
+
|
2368
|
+
|
2369
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2370
|
+
|
2371
|
+
|
2372
|
+
|
2373
|
+
</li>
|
2374
|
+
|
2375
|
+
</ul>
|
2376
|
+
|
2377
|
+
<p class="tag_title">Returns:</p>
|
2378
|
+
<ul class="return">
|
2379
|
+
|
2380
|
+
<li>
|
2381
|
+
|
2382
|
+
|
2383
|
+
<span class='type'>(<tt>true</tt>)</span>
|
2384
|
+
|
2385
|
+
|
2386
|
+
|
2387
|
+
</li>
|
2388
|
+
|
2389
|
+
</ul>
|
2390
|
+
|
2391
|
+
</div><table class="source_code">
|
2392
|
+
<tr>
|
2393
|
+
<td>
|
2394
|
+
<pre class="lines">
|
2395
|
+
|
2396
|
+
|
2397
|
+
54</pre>
|
2398
|
+
</td>
|
2399
|
+
<td>
|
2400
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 54</span>
|
2401
|
+
|
2402
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:egg</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>oo</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#YELLOW-constant" title="Swarm::Console::Color::YELLOW (constant)">YELLOW</a></span></span></pre>
|
2403
|
+
</td>
|
2404
|
+
</tr>
|
2405
|
+
</table>
|
2406
|
+
</div>
|
2407
|
+
|
2408
|
+
<div class="method_details ">
|
2409
|
+
<h3 class="signature " id="egg!-instance_method">
|
2410
|
+
|
2411
|
+
#<strong>egg!</strong> ⇒ <tt>true</tt>
|
2412
|
+
|
2413
|
+
|
2414
|
+
|
2415
|
+
|
2416
|
+
|
2417
|
+
</h3><div class="docstring">
|
2418
|
+
<div class="discussion">
|
2419
|
+
|
2420
|
+
<p>set the <code>type</code> to :egg, the <code>icon</code> to 'oo',
|
2421
|
+
the <code>color</code> to color: YELLOW, the <code>age</code> to 0, and
|
2422
|
+
flags the tile to be updated by the <code>Console</code></p>
|
2423
|
+
|
2424
|
+
|
2425
|
+
</div>
|
2426
|
+
</div>
|
2427
|
+
<div class="tags">
|
2428
|
+
<p class="tag_title">Parameters:</p>
|
2429
|
+
<ul class="param">
|
2430
|
+
|
2431
|
+
<li>
|
2432
|
+
|
2433
|
+
<span class='name'>age</span>
|
2434
|
+
|
2435
|
+
|
2436
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2437
|
+
|
2438
|
+
|
2439
|
+
|
2440
|
+
</li>
|
2441
|
+
|
2442
|
+
</ul>
|
2443
|
+
|
2444
|
+
<p class="tag_title">Returns:</p>
|
2445
|
+
<ul class="return">
|
2446
|
+
|
2447
|
+
<li>
|
2448
|
+
|
2449
|
+
|
2450
|
+
<span class='type'>(<tt>true</tt>)</span>
|
2451
|
+
|
2452
|
+
|
2453
|
+
|
2454
|
+
</li>
|
2455
|
+
|
2456
|
+
</ul>
|
2457
|
+
|
2458
|
+
</div><table class="source_code">
|
2459
|
+
<tr>
|
2460
|
+
<td>
|
2461
|
+
<pre class="lines">
|
2462
|
+
|
2463
|
+
|
2464
|
+
54</pre>
|
2465
|
+
</td>
|
2466
|
+
<td>
|
2467
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 54</span>
|
2468
|
+
|
2469
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:egg</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>oo</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#YELLOW-constant" title="Swarm::Console::Color::YELLOW (constant)">YELLOW</a></span></span></pre>
|
2470
|
+
</td>
|
2471
|
+
</tr>
|
2472
|
+
</table>
|
2473
|
+
</div>
|
2474
|
+
|
2475
|
+
<div class="method_details ">
|
2476
|
+
<h3 class="signature " id="egg?-instance_method">
|
2477
|
+
|
2478
|
+
#<strong>egg?</strong> ⇒ <tt>Boolean</tt>
|
2479
|
+
|
2480
|
+
|
2481
|
+
|
2482
|
+
|
2483
|
+
|
2484
|
+
</h3><div class="docstring">
|
2485
|
+
<div class="discussion">
|
2486
|
+
|
2487
|
+
<p>test the value of <code>type</code></p>
|
2488
|
+
|
2489
|
+
|
2490
|
+
</div>
|
2491
|
+
</div>
|
2492
|
+
<div class="tags">
|
2493
|
+
|
2494
|
+
<p class="tag_title">Returns:</p>
|
2495
|
+
<ul class="return">
|
2496
|
+
|
2497
|
+
<li>
|
2498
|
+
|
2499
|
+
|
2500
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
2501
|
+
|
2502
|
+
|
2503
|
+
|
2504
|
+
—
|
2505
|
+
<div class='inline'>
|
2506
|
+
<p><code>true</code> if <code>type</code> is egg, <code>false</code> if it is
|
2507
|
+
not</p>
|
2508
|
+
</div>
|
2509
|
+
|
2510
|
+
</li>
|
2511
|
+
|
2512
|
+
</ul>
|
2513
|
+
|
2514
|
+
</div><table class="source_code">
|
2515
|
+
<tr>
|
2516
|
+
<td>
|
2517
|
+
<pre class="lines">
|
2518
|
+
|
2519
|
+
|
2520
|
+
54</pre>
|
2521
|
+
</td>
|
2522
|
+
<td>
|
2523
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 54</span>
|
2524
|
+
|
2525
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:egg</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>oo</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#YELLOW-constant" title="Swarm::Console::Color::YELLOW (constant)">YELLOW</a></span></span></pre>
|
2526
|
+
</td>
|
2527
|
+
</tr>
|
2528
|
+
</table>
|
2529
|
+
</div>
|
2530
|
+
|
2531
|
+
<div class="method_details ">
|
2532
|
+
<h3 class="signature " id="empty-instance_method">
|
2533
|
+
|
2534
|
+
#<strong>empty</strong> ⇒ <tt>true</tt>
|
2535
|
+
|
2536
|
+
|
2537
|
+
|
2538
|
+
|
2539
|
+
|
2540
|
+
</h3><div class="docstring">
|
2541
|
+
<div class="discussion">
|
2542
|
+
|
2543
|
+
<p>set the <code>type</code> to :empty, the <code>icon</code> to + +, the
|
2544
|
+
<code>color</code> to color: BLACK, the <code>age</code> to and flags the
|
2545
|
+
tile to be updated by the <code>Console</code> attr_type, empty, , color:
|
2546
|
+
BLACK, , , ,</p>
|
2547
|
+
|
2548
|
+
|
2549
|
+
</div>
|
2550
|
+
</div>
|
2551
|
+
<div class="tags">
|
2552
|
+
<p class="tag_title">Parameters:</p>
|
2553
|
+
<ul class="param">
|
2554
|
+
|
2555
|
+
<li>
|
2556
|
+
|
2557
|
+
<span class='name'>age</span>
|
2558
|
+
|
2559
|
+
|
2560
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2561
|
+
|
2562
|
+
|
2563
|
+
|
2564
|
+
</li>
|
2565
|
+
|
2566
|
+
</ul>
|
2567
|
+
|
2568
|
+
<p class="tag_title">Returns:</p>
|
2569
|
+
<ul class="return">
|
2570
|
+
|
2571
|
+
<li>
|
2572
|
+
|
2573
|
+
|
2574
|
+
<span class='type'>(<tt>true</tt>)</span>
|
2575
|
+
|
2576
|
+
|
2577
|
+
|
2578
|
+
</li>
|
2579
|
+
|
2580
|
+
</ul>
|
2581
|
+
|
2582
|
+
</div><table class="source_code">
|
2583
|
+
<tr>
|
2584
|
+
<td>
|
2585
|
+
<pre class="lines">
|
2586
|
+
|
2587
|
+
|
2588
|
+
48</pre>
|
2589
|
+
</td>
|
2590
|
+
<td>
|
2591
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 48</span>
|
2592
|
+
|
2593
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:empty</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#BLACK-constant" title="Swarm::Console::Color::BLACK (constant)">BLACK</a></span></span></pre>
|
2594
|
+
</td>
|
2595
|
+
</tr>
|
2596
|
+
</table>
|
2597
|
+
</div>
|
2598
|
+
|
2599
|
+
<div class="method_details ">
|
2600
|
+
<h3 class="signature " id="empty!-instance_method">
|
2601
|
+
|
2602
|
+
#<strong>empty!</strong> ⇒ <tt>true</tt>
|
2603
|
+
|
2604
|
+
|
2605
|
+
|
2606
|
+
|
2607
|
+
|
2608
|
+
</h3><div class="docstring">
|
2609
|
+
<div class="discussion">
|
2610
|
+
|
2611
|
+
<p>set the <code>type</code> to :empty, the <code>icon</code> to ' ',
|
2612
|
+
the <code>color</code> to color: BLACK, the <code>age</code> to 0, and
|
2613
|
+
flags the tile to be updated by the <code>Console</code></p>
|
2614
|
+
|
2615
|
+
|
2616
|
+
</div>
|
2617
|
+
</div>
|
2618
|
+
<div class="tags">
|
2619
|
+
<p class="tag_title">Parameters:</p>
|
2620
|
+
<ul class="param">
|
2621
|
+
|
2622
|
+
<li>
|
2623
|
+
|
2624
|
+
<span class='name'>age</span>
|
2625
|
+
|
2626
|
+
|
2627
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2628
|
+
|
2629
|
+
|
2630
|
+
|
2631
|
+
</li>
|
2632
|
+
|
2633
|
+
</ul>
|
2634
|
+
|
2635
|
+
<p class="tag_title">Returns:</p>
|
2636
|
+
<ul class="return">
|
2637
|
+
|
2638
|
+
<li>
|
2639
|
+
|
2640
|
+
|
2641
|
+
<span class='type'>(<tt>true</tt>)</span>
|
2642
|
+
|
2643
|
+
|
2644
|
+
|
2645
|
+
</li>
|
2646
|
+
|
2647
|
+
</ul>
|
2648
|
+
|
2649
|
+
</div><table class="source_code">
|
2650
|
+
<tr>
|
2651
|
+
<td>
|
2652
|
+
<pre class="lines">
|
2653
|
+
|
2654
|
+
|
2655
|
+
48</pre>
|
2656
|
+
</td>
|
2657
|
+
<td>
|
2658
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 48</span>
|
2659
|
+
|
2660
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:empty</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#BLACK-constant" title="Swarm::Console::Color::BLACK (constant)">BLACK</a></span></span></pre>
|
2661
|
+
</td>
|
2662
|
+
</tr>
|
2663
|
+
</table>
|
2664
|
+
</div>
|
2665
|
+
|
2666
|
+
<div class="method_details ">
|
2667
|
+
<h3 class="signature " id="empty?-instance_method">
|
2668
|
+
|
2669
|
+
#<strong>empty?</strong> ⇒ <tt>Boolean</tt>
|
2670
|
+
|
2671
|
+
|
2672
|
+
|
2673
|
+
|
2674
|
+
|
2675
|
+
</h3><div class="docstring">
|
2676
|
+
<div class="discussion">
|
2677
|
+
|
2678
|
+
<p>test the value of <code>type</code></p>
|
2679
|
+
|
2680
|
+
|
2681
|
+
</div>
|
2682
|
+
</div>
|
2683
|
+
<div class="tags">
|
2684
|
+
|
2685
|
+
<p class="tag_title">Returns:</p>
|
2686
|
+
<ul class="return">
|
2687
|
+
|
2688
|
+
<li>
|
2689
|
+
|
2690
|
+
|
2691
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
2692
|
+
|
2693
|
+
|
2694
|
+
|
2695
|
+
—
|
2696
|
+
<div class='inline'>
|
2697
|
+
<p><code>true</code> if <code>type</code> is empty, <code>false</code> if it
|
2698
|
+
is not</p>
|
2699
|
+
</div>
|
2700
|
+
|
2701
|
+
</li>
|
2702
|
+
|
2703
|
+
</ul>
|
2704
|
+
|
2705
|
+
</div><table class="source_code">
|
2706
|
+
<tr>
|
2707
|
+
<td>
|
2708
|
+
<pre class="lines">
|
2709
|
+
|
2710
|
+
|
2711
|
+
48</pre>
|
2712
|
+
</td>
|
2713
|
+
<td>
|
2714
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 48</span>
|
2715
|
+
|
2716
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:empty</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#BLACK-constant" title="Swarm::Console::Color::BLACK (constant)">BLACK</a></span></span></pre>
|
2717
|
+
</td>
|
2718
|
+
</tr>
|
2719
|
+
</table>
|
2720
|
+
</div>
|
2721
|
+
|
2722
|
+
<div class="method_details ">
|
2723
|
+
<h3 class="signature " id="enemy?-instance_method">
|
2724
|
+
|
2725
|
+
#<strong>enemy?</strong> ⇒ <tt>Boolean</tt>
|
2726
|
+
|
2727
|
+
|
2728
|
+
|
2729
|
+
|
2730
|
+
|
2731
|
+
</h3><div class="docstring">
|
2732
|
+
<div class="discussion">
|
2733
|
+
|
2734
|
+
|
2735
|
+
</div>
|
2736
|
+
</div>
|
2737
|
+
<div class="tags">
|
2738
|
+
|
2739
|
+
<p class="tag_title">Returns:</p>
|
2740
|
+
<ul class="return">
|
2741
|
+
|
2742
|
+
<li>
|
2743
|
+
|
2744
|
+
|
2745
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
2746
|
+
|
2747
|
+
|
2748
|
+
|
2749
|
+
</li>
|
2750
|
+
|
2751
|
+
</ul>
|
2752
|
+
|
2753
|
+
</div><table class="source_code">
|
2754
|
+
<tr>
|
2755
|
+
<td>
|
2756
|
+
<pre class="lines">
|
2757
|
+
|
2758
|
+
|
2759
|
+
116
|
2760
|
+
117
|
2761
|
+
118</pre>
|
2762
|
+
</td>
|
2763
|
+
<td>
|
2764
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 116</span>
|
2765
|
+
|
2766
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_enemy?'>enemy?</span>
|
2767
|
+
<span class='id identifier rubyid_worker?'>worker?</span> <span class='op'>||</span> <span class='id identifier rubyid_soldier?'>soldier?</span> <span class='op'>||</span> <span class='id identifier rubyid_queen?'>queen?</span>
|
2768
|
+
<span class='kw'>end</span></pre>
|
2769
|
+
</td>
|
2770
|
+
</tr>
|
2771
|
+
</table>
|
2772
|
+
</div>
|
2773
|
+
|
2774
|
+
<div class="method_details ">
|
2775
|
+
<h3 class="signature " id="inspect-instance_method">
|
2776
|
+
|
2777
|
+
#<strong>inspect</strong> ⇒ <tt>Object</tt>
|
2778
|
+
|
2779
|
+
|
2780
|
+
|
2781
|
+
|
2782
|
+
|
2783
|
+
</h3><table class="source_code">
|
2784
|
+
<tr>
|
2785
|
+
<td>
|
2786
|
+
<pre class="lines">
|
2787
|
+
|
2788
|
+
|
2789
|
+
96
|
2790
|
+
97
|
2791
|
+
98</pre>
|
2792
|
+
</td>
|
2793
|
+
<td>
|
2794
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 96</span>
|
2795
|
+
|
2796
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_inspect'>inspect</span>
|
2797
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>#<%s:0x%014x @x=%p, @y=%p, @type=%p></span><span class='tstring_end'>'</span></span> <span class='op'>%</span> <span class='lbracket'>[</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='comma'>,</span> <span class='id identifier rubyid_object_id'>object_id</span> <span class='op'><<</span> <span class='int'>1</span><span class='comma'>,</span> <span class='ivar'>@x</span><span class='comma'>,</span> <span class='ivar'>@y</span><span class='comma'>,</span> <span class='ivar'>@type</span><span class='rbracket'>]</span>
|
2798
|
+
<span class='kw'>end</span></pre>
|
2799
|
+
</td>
|
2800
|
+
</tr>
|
2801
|
+
</table>
|
2802
|
+
</div>
|
2803
|
+
|
2804
|
+
<div class="method_details ">
|
2805
|
+
<h3 class="signature " id="mover?-instance_method">
|
2806
|
+
|
2807
|
+
#<strong>mover?</strong> ⇒ <tt>Boolean</tt>
|
2808
|
+
|
2809
|
+
|
2810
|
+
|
2811
|
+
|
2812
|
+
|
2813
|
+
</h3><div class="docstring">
|
2814
|
+
<div class="discussion">
|
2815
|
+
|
2816
|
+
|
2817
|
+
</div>
|
2818
|
+
</div>
|
2819
|
+
<div class="tags">
|
2820
|
+
|
2821
|
+
<p class="tag_title">Returns:</p>
|
2822
|
+
<ul class="return">
|
2823
|
+
|
2824
|
+
<li>
|
2825
|
+
|
2826
|
+
|
2827
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
2828
|
+
|
2829
|
+
|
2830
|
+
|
2831
|
+
</li>
|
2832
|
+
|
2833
|
+
</ul>
|
2834
|
+
|
2835
|
+
</div><table class="source_code">
|
2836
|
+
<tr>
|
2837
|
+
<td>
|
2838
|
+
<pre class="lines">
|
2839
|
+
|
2840
|
+
|
2841
|
+
121
|
2842
|
+
122
|
2843
|
+
123</pre>
|
2844
|
+
</td>
|
2845
|
+
<td>
|
2846
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 121</span>
|
2847
|
+
|
2848
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_mover?'>mover?</span>
|
2849
|
+
<span class='id identifier rubyid_player?'>player?</span> <span class='op'>||</span> <span class='id identifier rubyid_queen?'>queen?</span>
|
2850
|
+
<span class='kw'>end</span></pre>
|
2851
|
+
</td>
|
2852
|
+
</tr>
|
2853
|
+
</table>
|
2854
|
+
</div>
|
2855
|
+
|
2856
|
+
<div class="method_details ">
|
2857
|
+
<h3 class="signature " id="player-instance_method">
|
2858
|
+
|
2859
|
+
#<strong>player</strong> ⇒ <tt>true</tt>
|
2860
|
+
|
2861
|
+
|
2862
|
+
|
2863
|
+
|
2864
|
+
|
2865
|
+
</h3><div class="docstring">
|
2866
|
+
<div class="discussion">
|
2867
|
+
|
2868
|
+
<p>set the <code>type</code> to :player, the <code>icon</code> to <tt>◄▶</tt>, the
|
2869
|
+
<code>color</code> to color: GREEN, the <code>age</code> to and flags the
|
2870
|
+
tile to be updated by the <code>Console</code> attr_type, player, ◄▶,
|
2871
|
+
color: GREEN, , , ,</p>
|
2872
|
+
|
2873
|
+
|
2874
|
+
</div>
|
2875
|
+
</div>
|
2876
|
+
<div class="tags">
|
2877
|
+
<p class="tag_title">Parameters:</p>
|
2878
|
+
<ul class="param">
|
2879
|
+
|
2880
|
+
<li>
|
2881
|
+
|
2882
|
+
<span class='name'>age</span>
|
2883
|
+
|
2884
|
+
|
2885
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2886
|
+
|
2887
|
+
|
2888
|
+
|
2889
|
+
</li>
|
2890
|
+
|
2891
|
+
</ul>
|
2892
|
+
|
2893
|
+
<p class="tag_title">Returns:</p>
|
2894
|
+
<ul class="return">
|
2895
|
+
|
2896
|
+
<li>
|
2897
|
+
|
2898
|
+
|
2899
|
+
<span class='type'>(<tt>true</tt>)</span>
|
2900
|
+
|
2901
|
+
|
2902
|
+
|
2903
|
+
</li>
|
2904
|
+
|
2905
|
+
</ul>
|
2906
|
+
|
2907
|
+
</div><table class="source_code">
|
2908
|
+
<tr>
|
2909
|
+
<td>
|
2910
|
+
<pre class="lines">
|
2911
|
+
|
2912
|
+
|
2913
|
+
55</pre>
|
2914
|
+
</td>
|
2915
|
+
<td>
|
2916
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 55</span>
|
2917
|
+
|
2918
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:player</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>◄▶</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#GREEN-constant" title="Swarm::Console::Color::GREEN (constant)">GREEN</a></span></span></pre>
|
2919
|
+
</td>
|
2920
|
+
</tr>
|
2921
|
+
</table>
|
2922
|
+
</div>
|
2923
|
+
|
2924
|
+
<div class="method_details ">
|
2925
|
+
<h3 class="signature " id="player!-instance_method">
|
2926
|
+
|
2927
|
+
#<strong>player!</strong> ⇒ <tt>true</tt>
|
2928
|
+
|
2929
|
+
|
2930
|
+
|
2931
|
+
|
2932
|
+
|
2933
|
+
</h3><div class="docstring">
|
2934
|
+
<div class="discussion">
|
2935
|
+
|
2936
|
+
<p>set the <code>type</code> to :player, the <code>icon</code> to
|
2937
|
+
'◄▶', the <code>color</code> to color: GREEN, the <code>age</code>
|
2938
|
+
to 0, and flags the tile to be updated by the <code>Console</code></p>
|
2939
|
+
|
2940
|
+
|
2941
|
+
</div>
|
2942
|
+
</div>
|
2943
|
+
<div class="tags">
|
2944
|
+
<p class="tag_title">Parameters:</p>
|
2945
|
+
<ul class="param">
|
2946
|
+
|
2947
|
+
<li>
|
2948
|
+
|
2949
|
+
<span class='name'>age</span>
|
2950
|
+
|
2951
|
+
|
2952
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2953
|
+
|
2954
|
+
|
2955
|
+
|
2956
|
+
</li>
|
2957
|
+
|
2958
|
+
</ul>
|
2959
|
+
|
2960
|
+
<p class="tag_title">Returns:</p>
|
2961
|
+
<ul class="return">
|
2962
|
+
|
2963
|
+
<li>
|
2964
|
+
|
2965
|
+
|
2966
|
+
<span class='type'>(<tt>true</tt>)</span>
|
2967
|
+
|
2968
|
+
|
2969
|
+
|
2970
|
+
</li>
|
2971
|
+
|
2972
|
+
</ul>
|
2973
|
+
|
2974
|
+
</div><table class="source_code">
|
2975
|
+
<tr>
|
2976
|
+
<td>
|
2977
|
+
<pre class="lines">
|
2978
|
+
|
2979
|
+
|
2980
|
+
55</pre>
|
2981
|
+
</td>
|
2982
|
+
<td>
|
2983
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 55</span>
|
2984
|
+
|
2985
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:player</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>◄▶</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#GREEN-constant" title="Swarm::Console::Color::GREEN (constant)">GREEN</a></span></span></pre>
|
2986
|
+
</td>
|
2987
|
+
</tr>
|
2988
|
+
</table>
|
2989
|
+
</div>
|
2990
|
+
|
2991
|
+
<div class="method_details ">
|
2992
|
+
<h3 class="signature " id="player?-instance_method">
|
2993
|
+
|
2994
|
+
#<strong>player?</strong> ⇒ <tt>Boolean</tt>
|
2995
|
+
|
2996
|
+
|
2997
|
+
|
2998
|
+
|
2999
|
+
|
3000
|
+
</h3><div class="docstring">
|
3001
|
+
<div class="discussion">
|
3002
|
+
|
3003
|
+
<p>test the value of <code>type</code></p>
|
3004
|
+
|
3005
|
+
|
3006
|
+
</div>
|
3007
|
+
</div>
|
3008
|
+
<div class="tags">
|
3009
|
+
|
3010
|
+
<p class="tag_title">Returns:</p>
|
3011
|
+
<ul class="return">
|
3012
|
+
|
3013
|
+
<li>
|
3014
|
+
|
3015
|
+
|
3016
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
3017
|
+
|
3018
|
+
|
3019
|
+
|
3020
|
+
—
|
3021
|
+
<div class='inline'>
|
3022
|
+
<p><code>true</code> if <code>type</code> is player, <code>false</code> if it
|
3023
|
+
is not</p>
|
3024
|
+
</div>
|
3025
|
+
|
3026
|
+
</li>
|
3027
|
+
|
3028
|
+
</ul>
|
3029
|
+
|
3030
|
+
</div><table class="source_code">
|
3031
|
+
<tr>
|
3032
|
+
<td>
|
3033
|
+
<pre class="lines">
|
3034
|
+
|
3035
|
+
|
3036
|
+
55</pre>
|
3037
|
+
</td>
|
3038
|
+
<td>
|
3039
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 55</span>
|
3040
|
+
|
3041
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:player</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>◄▶</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#GREEN-constant" title="Swarm::Console::Color::GREEN (constant)">GREEN</a></span></span></pre>
|
3042
|
+
</td>
|
3043
|
+
</tr>
|
3044
|
+
</table>
|
3045
|
+
</div>
|
3046
|
+
|
3047
|
+
<div class="method_details ">
|
3048
|
+
<h3 class="signature " id="queen-instance_method">
|
3049
|
+
|
3050
|
+
#<strong>queen</strong> ⇒ <tt>true</tt>
|
3051
|
+
|
3052
|
+
|
3053
|
+
|
3054
|
+
|
3055
|
+
|
3056
|
+
</h3><div class="docstring">
|
3057
|
+
<div class="discussion">
|
3058
|
+
|
3059
|
+
<p>set the <code>type</code> to :queen, the <code>icon</code> to <tt>╬╬</tt>, the
|
3060
|
+
<code>color</code> to color: PURPLE, the <code>age</code> to and flags the
|
3061
|
+
tile to be updated by the <code>Console</code> attr_type, queen, ╬╬, color:
|
3062
|
+
PURPLE, , , ,</p>
|
3063
|
+
|
3064
|
+
|
3065
|
+
</div>
|
3066
|
+
</div>
|
3067
|
+
<div class="tags">
|
3068
|
+
<p class="tag_title">Parameters:</p>
|
3069
|
+
<ul class="param">
|
3070
|
+
|
3071
|
+
<li>
|
3072
|
+
|
3073
|
+
<span class='name'>age</span>
|
3074
|
+
|
3075
|
+
|
3076
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
3077
|
+
|
3078
|
+
|
3079
|
+
|
3080
|
+
</li>
|
3081
|
+
|
3082
|
+
</ul>
|
3083
|
+
|
3084
|
+
<p class="tag_title">Returns:</p>
|
3085
|
+
<ul class="return">
|
3086
|
+
|
3087
|
+
<li>
|
3088
|
+
|
3089
|
+
|
3090
|
+
<span class='type'>(<tt>true</tt>)</span>
|
3091
|
+
|
3092
|
+
|
3093
|
+
|
3094
|
+
</li>
|
3095
|
+
|
3096
|
+
</ul>
|
3097
|
+
|
3098
|
+
</div><table class="source_code">
|
3099
|
+
<tr>
|
3100
|
+
<td>
|
3101
|
+
<pre class="lines">
|
3102
|
+
|
3103
|
+
|
3104
|
+
53</pre>
|
3105
|
+
</td>
|
3106
|
+
<td>
|
3107
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 53</span>
|
3108
|
+
|
3109
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:queen</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>╬╬</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#PURPLE-constant" title="Swarm::Console::Color::PURPLE (constant)">PURPLE</a></span></span></pre>
|
3110
|
+
</td>
|
3111
|
+
</tr>
|
3112
|
+
</table>
|
3113
|
+
</div>
|
3114
|
+
|
3115
|
+
<div class="method_details ">
|
3116
|
+
<h3 class="signature " id="queen!-instance_method">
|
3117
|
+
|
3118
|
+
#<strong>queen!</strong> ⇒ <tt>true</tt>
|
3119
|
+
|
3120
|
+
|
3121
|
+
|
3122
|
+
|
3123
|
+
|
3124
|
+
</h3><div class="docstring">
|
3125
|
+
<div class="discussion">
|
3126
|
+
|
3127
|
+
<p>set the <code>type</code> to :queen, the <code>icon</code> to '╬╬',
|
3128
|
+
the <code>color</code> to color: PURPLE, the <code>age</code> to 0, and
|
3129
|
+
flags the tile to be updated by the <code>Console</code></p>
|
3130
|
+
|
3131
|
+
|
3132
|
+
</div>
|
3133
|
+
</div>
|
3134
|
+
<div class="tags">
|
3135
|
+
<p class="tag_title">Parameters:</p>
|
3136
|
+
<ul class="param">
|
3137
|
+
|
3138
|
+
<li>
|
3139
|
+
|
3140
|
+
<span class='name'>age</span>
|
3141
|
+
|
3142
|
+
|
3143
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
3144
|
+
|
3145
|
+
|
3146
|
+
|
3147
|
+
</li>
|
3148
|
+
|
3149
|
+
</ul>
|
3150
|
+
|
3151
|
+
<p class="tag_title">Returns:</p>
|
3152
|
+
<ul class="return">
|
3153
|
+
|
3154
|
+
<li>
|
3155
|
+
|
3156
|
+
|
3157
|
+
<span class='type'>(<tt>true</tt>)</span>
|
3158
|
+
|
3159
|
+
|
3160
|
+
|
3161
|
+
</li>
|
3162
|
+
|
3163
|
+
</ul>
|
3164
|
+
|
3165
|
+
</div><table class="source_code">
|
3166
|
+
<tr>
|
3167
|
+
<td>
|
3168
|
+
<pre class="lines">
|
3169
|
+
|
3170
|
+
|
3171
|
+
53</pre>
|
3172
|
+
</td>
|
3173
|
+
<td>
|
3174
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 53</span>
|
3175
|
+
|
3176
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:queen</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>╬╬</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#PURPLE-constant" title="Swarm::Console::Color::PURPLE (constant)">PURPLE</a></span></span></pre>
|
3177
|
+
</td>
|
3178
|
+
</tr>
|
3179
|
+
</table>
|
3180
|
+
</div>
|
3181
|
+
|
3182
|
+
<div class="method_details ">
|
3183
|
+
<h3 class="signature " id="queen?-instance_method">
|
3184
|
+
|
3185
|
+
#<strong>queen?</strong> ⇒ <tt>Boolean</tt>
|
3186
|
+
|
3187
|
+
|
3188
|
+
|
3189
|
+
|
3190
|
+
|
3191
|
+
</h3><div class="docstring">
|
3192
|
+
<div class="discussion">
|
3193
|
+
|
3194
|
+
<p>test the value of <code>type</code></p>
|
3195
|
+
|
3196
|
+
|
3197
|
+
</div>
|
3198
|
+
</div>
|
3199
|
+
<div class="tags">
|
3200
|
+
|
3201
|
+
<p class="tag_title">Returns:</p>
|
3202
|
+
<ul class="return">
|
3203
|
+
|
3204
|
+
<li>
|
3205
|
+
|
3206
|
+
|
3207
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
3208
|
+
|
3209
|
+
|
3210
|
+
|
3211
|
+
—
|
3212
|
+
<div class='inline'>
|
3213
|
+
<p><code>true</code> if <code>type</code> is queen, <code>false</code> if it
|
3214
|
+
is not</p>
|
3215
|
+
</div>
|
3216
|
+
|
3217
|
+
</li>
|
3218
|
+
|
3219
|
+
</ul>
|
3220
|
+
|
3221
|
+
</div><table class="source_code">
|
3222
|
+
<tr>
|
3223
|
+
<td>
|
3224
|
+
<pre class="lines">
|
3225
|
+
|
3226
|
+
|
3227
|
+
53</pre>
|
3228
|
+
</td>
|
3229
|
+
<td>
|
3230
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 53</span>
|
3231
|
+
|
3232
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:queen</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>╬╬</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#PURPLE-constant" title="Swarm::Console::Color::PURPLE (constant)">PURPLE</a></span></span></pre>
|
3233
|
+
</td>
|
3234
|
+
</tr>
|
3235
|
+
</table>
|
3236
|
+
</div>
|
3237
|
+
|
3238
|
+
<div class="method_details ">
|
3239
|
+
<h3 class="signature " id="rock-instance_method">
|
3240
|
+
|
3241
|
+
#<strong>rock</strong> ⇒ <tt>true</tt>
|
3242
|
+
|
3243
|
+
|
3244
|
+
|
3245
|
+
|
3246
|
+
|
3247
|
+
</h3><div class="docstring">
|
3248
|
+
<div class="discussion">
|
3249
|
+
|
3250
|
+
<p>set the <code>type</code> to :rock, the <code>icon</code> to <tt>██</tt>, the
|
3251
|
+
<code>color</code> to color: WHITE, the <code>age</code> to and flags the
|
3252
|
+
tile to be updated by the <code>Console</code> attr_type, rock, ██, color:
|
3253
|
+
WHITE, , , ,</p>
|
3254
|
+
|
3255
|
+
|
3256
|
+
</div>
|
3257
|
+
</div>
|
3258
|
+
<div class="tags">
|
3259
|
+
<p class="tag_title">Parameters:</p>
|
3260
|
+
<ul class="param">
|
3261
|
+
|
3262
|
+
<li>
|
3263
|
+
|
3264
|
+
<span class='name'>age</span>
|
3265
|
+
|
3266
|
+
|
3267
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
3268
|
+
|
3269
|
+
|
3270
|
+
|
3271
|
+
</li>
|
3272
|
+
|
3273
|
+
</ul>
|
3274
|
+
|
3275
|
+
<p class="tag_title">Returns:</p>
|
3276
|
+
<ul class="return">
|
3277
|
+
|
3278
|
+
<li>
|
3279
|
+
|
3280
|
+
|
3281
|
+
<span class='type'>(<tt>true</tt>)</span>
|
3282
|
+
|
3283
|
+
|
3284
|
+
|
3285
|
+
</li>
|
3286
|
+
|
3287
|
+
</ul>
|
3288
|
+
|
3289
|
+
</div><table class="source_code">
|
3290
|
+
<tr>
|
3291
|
+
<td>
|
3292
|
+
<pre class="lines">
|
3293
|
+
|
3294
|
+
|
3295
|
+
50</pre>
|
3296
|
+
</td>
|
3297
|
+
<td>
|
3298
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 50</span>
|
3299
|
+
|
3300
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:rock</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>██</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#WHITE-constant" title="Swarm::Console::Color::WHITE (constant)">WHITE</a></span></span></pre>
|
3301
|
+
</td>
|
3302
|
+
</tr>
|
3303
|
+
</table>
|
3304
|
+
</div>
|
3305
|
+
|
3306
|
+
<div class="method_details ">
|
3307
|
+
<h3 class="signature " id="rock!-instance_method">
|
3308
|
+
|
3309
|
+
#<strong>rock!</strong> ⇒ <tt>true</tt>
|
3310
|
+
|
3311
|
+
|
3312
|
+
|
3313
|
+
|
3314
|
+
|
3315
|
+
</h3><div class="docstring">
|
3316
|
+
<div class="discussion">
|
3317
|
+
|
3318
|
+
<p>set the <code>type</code> to :rock, the <code>icon</code> to '██',
|
3319
|
+
the <code>color</code> to color: WHITE, the <code>age</code> to 0, and
|
3320
|
+
flags the tile to be updated by the <code>Console</code></p>
|
3321
|
+
|
3322
|
+
|
3323
|
+
</div>
|
3324
|
+
</div>
|
3325
|
+
<div class="tags">
|
3326
|
+
<p class="tag_title">Parameters:</p>
|
3327
|
+
<ul class="param">
|
3328
|
+
|
3329
|
+
<li>
|
3330
|
+
|
3331
|
+
<span class='name'>age</span>
|
3332
|
+
|
3333
|
+
|
3334
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
3335
|
+
|
3336
|
+
|
3337
|
+
|
3338
|
+
</li>
|
3339
|
+
|
3340
|
+
</ul>
|
3341
|
+
|
3342
|
+
<p class="tag_title">Returns:</p>
|
3343
|
+
<ul class="return">
|
3344
|
+
|
3345
|
+
<li>
|
3346
|
+
|
3347
|
+
|
3348
|
+
<span class='type'>(<tt>true</tt>)</span>
|
3349
|
+
|
3350
|
+
|
3351
|
+
|
3352
|
+
</li>
|
3353
|
+
|
3354
|
+
</ul>
|
3355
|
+
|
3356
|
+
</div><table class="source_code">
|
3357
|
+
<tr>
|
3358
|
+
<td>
|
3359
|
+
<pre class="lines">
|
3360
|
+
|
3361
|
+
|
3362
|
+
50</pre>
|
3363
|
+
</td>
|
3364
|
+
<td>
|
3365
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 50</span>
|
3366
|
+
|
3367
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:rock</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>██</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#WHITE-constant" title="Swarm::Console::Color::WHITE (constant)">WHITE</a></span></span></pre>
|
3368
|
+
</td>
|
3369
|
+
</tr>
|
3370
|
+
</table>
|
3371
|
+
</div>
|
3372
|
+
|
3373
|
+
<div class="method_details ">
|
3374
|
+
<h3 class="signature " id="rock?-instance_method">
|
3375
|
+
|
3376
|
+
#<strong>rock?</strong> ⇒ <tt>Boolean</tt>
|
3377
|
+
|
3378
|
+
|
3379
|
+
|
3380
|
+
|
3381
|
+
|
3382
|
+
</h3><div class="docstring">
|
3383
|
+
<div class="discussion">
|
3384
|
+
|
3385
|
+
<p>test the value of <code>type</code></p>
|
3386
|
+
|
3387
|
+
|
3388
|
+
</div>
|
3389
|
+
</div>
|
3390
|
+
<div class="tags">
|
3391
|
+
|
3392
|
+
<p class="tag_title">Returns:</p>
|
3393
|
+
<ul class="return">
|
3394
|
+
|
3395
|
+
<li>
|
3396
|
+
|
3397
|
+
|
3398
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
3399
|
+
|
3400
|
+
|
3401
|
+
|
3402
|
+
—
|
3403
|
+
<div class='inline'>
|
3404
|
+
<p><code>true</code> if <code>type</code> is rock, <code>false</code> if it is
|
3405
|
+
not</p>
|
3406
|
+
</div>
|
3407
|
+
|
3408
|
+
</li>
|
3409
|
+
|
3410
|
+
</ul>
|
3411
|
+
|
3412
|
+
</div><table class="source_code">
|
3413
|
+
<tr>
|
3414
|
+
<td>
|
3415
|
+
<pre class="lines">
|
3416
|
+
|
3417
|
+
|
3418
|
+
50</pre>
|
3419
|
+
</td>
|
3420
|
+
<td>
|
3421
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 50</span>
|
3422
|
+
|
3423
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:rock</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>██</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#WHITE-constant" title="Swarm::Console::Color::WHITE (constant)">WHITE</a></span></span></pre>
|
3424
|
+
</td>
|
3425
|
+
</tr>
|
3426
|
+
</table>
|
3427
|
+
</div>
|
3428
|
+
|
3429
|
+
<div class="method_details ">
|
3430
|
+
<h3 class="signature " id="soldier-instance_method">
|
3431
|
+
|
3432
|
+
#<strong>soldier</strong> ⇒ <tt>true</tt>
|
3433
|
+
|
3434
|
+
|
3435
|
+
|
3436
|
+
|
3437
|
+
|
3438
|
+
</h3><div class="docstring">
|
3439
|
+
<div class="discussion">
|
3440
|
+
|
3441
|
+
<p>set the <code>type</code> to :soldier, the <code>icon</code> to <tt>╟╢</tt>, the
|
3442
|
+
<code>color</code> to color: RED, the <code>age</code> to and flags the
|
3443
|
+
tile to be updated by the <code>Console</code> attr_type, soldier, ╟╢,
|
3444
|
+
color: RED, , , ,</p>
|
3445
|
+
|
3446
|
+
|
3447
|
+
</div>
|
3448
|
+
</div>
|
3449
|
+
<div class="tags">
|
3450
|
+
<p class="tag_title">Parameters:</p>
|
3451
|
+
<ul class="param">
|
3452
|
+
|
3453
|
+
<li>
|
3454
|
+
|
3455
|
+
<span class='name'>age</span>
|
3456
|
+
|
3457
|
+
|
3458
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
3459
|
+
|
3460
|
+
|
3461
|
+
|
3462
|
+
</li>
|
3463
|
+
|
3464
|
+
</ul>
|
3465
|
+
|
3466
|
+
<p class="tag_title">Returns:</p>
|
3467
|
+
<ul class="return">
|
3468
|
+
|
3469
|
+
<li>
|
3470
|
+
|
3471
|
+
|
3472
|
+
<span class='type'>(<tt>true</tt>)</span>
|
3473
|
+
|
3474
|
+
|
3475
|
+
|
3476
|
+
</li>
|
3477
|
+
|
3478
|
+
</ul>
|
3479
|
+
|
3480
|
+
</div><table class="source_code">
|
3481
|
+
<tr>
|
3482
|
+
<td>
|
3483
|
+
<pre class="lines">
|
3484
|
+
|
3485
|
+
|
3486
|
+
52</pre>
|
3487
|
+
</td>
|
3488
|
+
<td>
|
3489
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 52</span>
|
3490
|
+
|
3491
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:soldier</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>╟╢</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#RED-constant" title="Swarm::Console::Color::RED (constant)">RED</a></span></span></pre>
|
3492
|
+
</td>
|
3493
|
+
</tr>
|
3494
|
+
</table>
|
3495
|
+
</div>
|
3496
|
+
|
3497
|
+
<div class="method_details ">
|
3498
|
+
<h3 class="signature " id="soldier!-instance_method">
|
3499
|
+
|
3500
|
+
#<strong>soldier!</strong> ⇒ <tt>true</tt>
|
3501
|
+
|
3502
|
+
|
3503
|
+
|
3504
|
+
|
3505
|
+
|
3506
|
+
</h3><div class="docstring">
|
3507
|
+
<div class="discussion">
|
3508
|
+
|
3509
|
+
<p>set the <code>type</code> to :soldier, the <code>icon</code> to
|
3510
|
+
'╟╢', the <code>color</code> to color: RED, the <code>age</code> to
|
3511
|
+
0, and flags the tile to be updated by the <code>Console</code></p>
|
3512
|
+
|
3513
|
+
|
3514
|
+
</div>
|
3515
|
+
</div>
|
3516
|
+
<div class="tags">
|
3517
|
+
<p class="tag_title">Parameters:</p>
|
3518
|
+
<ul class="param">
|
3519
|
+
|
3520
|
+
<li>
|
3521
|
+
|
3522
|
+
<span class='name'>age</span>
|
3523
|
+
|
3524
|
+
|
3525
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
3526
|
+
|
3527
|
+
|
3528
|
+
|
3529
|
+
</li>
|
3530
|
+
|
3531
|
+
</ul>
|
3532
|
+
|
3533
|
+
<p class="tag_title">Returns:</p>
|
3534
|
+
<ul class="return">
|
3535
|
+
|
3536
|
+
<li>
|
3537
|
+
|
3538
|
+
|
3539
|
+
<span class='type'>(<tt>true</tt>)</span>
|
3540
|
+
|
3541
|
+
|
3542
|
+
|
3543
|
+
</li>
|
3544
|
+
|
3545
|
+
</ul>
|
3546
|
+
|
3547
|
+
</div><table class="source_code">
|
3548
|
+
<tr>
|
3549
|
+
<td>
|
3550
|
+
<pre class="lines">
|
3551
|
+
|
3552
|
+
|
3553
|
+
52</pre>
|
3554
|
+
</td>
|
3555
|
+
<td>
|
3556
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 52</span>
|
3557
|
+
|
3558
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:soldier</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>╟╢</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#RED-constant" title="Swarm::Console::Color::RED (constant)">RED</a></span></span></pre>
|
3559
|
+
</td>
|
3560
|
+
</tr>
|
3561
|
+
</table>
|
3562
|
+
</div>
|
3563
|
+
|
3564
|
+
<div class="method_details ">
|
3565
|
+
<h3 class="signature " id="soldier?-instance_method">
|
3566
|
+
|
3567
|
+
#<strong>soldier?</strong> ⇒ <tt>Boolean</tt>
|
3568
|
+
|
3569
|
+
|
3570
|
+
|
3571
|
+
|
3572
|
+
|
3573
|
+
</h3><div class="docstring">
|
3574
|
+
<div class="discussion">
|
3575
|
+
|
3576
|
+
<p>test the value of <code>type</code></p>
|
3577
|
+
|
3578
|
+
|
3579
|
+
</div>
|
3580
|
+
</div>
|
3581
|
+
<div class="tags">
|
3582
|
+
|
3583
|
+
<p class="tag_title">Returns:</p>
|
3584
|
+
<ul class="return">
|
3585
|
+
|
3586
|
+
<li>
|
3587
|
+
|
3588
|
+
|
3589
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
3590
|
+
|
3591
|
+
|
3592
|
+
|
3593
|
+
—
|
3594
|
+
<div class='inline'>
|
3595
|
+
<p><code>true</code> if <code>type</code> is soldier, <code>false</code> if it
|
3596
|
+
is not</p>
|
3597
|
+
</div>
|
3598
|
+
|
3599
|
+
</li>
|
3600
|
+
|
3601
|
+
</ul>
|
3602
|
+
|
3603
|
+
</div><table class="source_code">
|
3604
|
+
<tr>
|
3605
|
+
<td>
|
3606
|
+
<pre class="lines">
|
3607
|
+
|
3608
|
+
|
3609
|
+
52</pre>
|
3610
|
+
</td>
|
3611
|
+
<td>
|
3612
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 52</span>
|
3613
|
+
|
3614
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:soldier</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>╟╢</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#RED-constant" title="Swarm::Console::Color::RED (constant)">RED</a></span></span></pre>
|
3615
|
+
</td>
|
3616
|
+
</tr>
|
3617
|
+
</table>
|
3618
|
+
</div>
|
3619
|
+
|
3620
|
+
<div class="method_details ">
|
3621
|
+
<h3 class="signature " id="worker-instance_method">
|
3622
|
+
|
3623
|
+
#<strong>worker</strong> ⇒ <tt>true</tt>
|
3624
|
+
|
3625
|
+
|
3626
|
+
|
3627
|
+
|
3628
|
+
|
3629
|
+
</h3><div class="docstring">
|
3630
|
+
<div class="discussion">
|
3631
|
+
|
3632
|
+
<p>set the <code>type</code> to :worker, the <code>icon</code> to <tt>├┤</tt>, the
|
3633
|
+
<code>color</code> to color: BLUE, the <code>age</code> to and flags the
|
3634
|
+
tile to be updated by the <code>Console</code> attr_type, worker, ├┤,
|
3635
|
+
color: BLUE, , , ,</p>
|
3636
|
+
|
3637
|
+
|
3638
|
+
</div>
|
3639
|
+
</div>
|
3640
|
+
<div class="tags">
|
3641
|
+
<p class="tag_title">Parameters:</p>
|
3642
|
+
<ul class="param">
|
3643
|
+
|
3644
|
+
<li>
|
3645
|
+
|
3646
|
+
<span class='name'>age</span>
|
3647
|
+
|
3648
|
+
|
3649
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
3650
|
+
|
3651
|
+
|
3652
|
+
|
3653
|
+
</li>
|
3654
|
+
|
3655
|
+
</ul>
|
3656
|
+
|
3657
|
+
<p class="tag_title">Returns:</p>
|
3658
|
+
<ul class="return">
|
3659
|
+
|
3660
|
+
<li>
|
3661
|
+
|
3662
|
+
|
3663
|
+
<span class='type'>(<tt>true</tt>)</span>
|
3664
|
+
|
3665
|
+
|
3666
|
+
|
3667
|
+
</li>
|
3668
|
+
|
3669
|
+
</ul>
|
3670
|
+
|
3671
|
+
</div><table class="source_code">
|
3672
|
+
<tr>
|
3673
|
+
<td>
|
3674
|
+
<pre class="lines">
|
3675
|
+
|
3676
|
+
|
3677
|
+
51</pre>
|
3678
|
+
</td>
|
3679
|
+
<td>
|
3680
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 51</span>
|
3681
|
+
|
3682
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:worker</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>├┤</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#BLUE-constant" title="Swarm::Console::Color::BLUE (constant)">BLUE</a></span></span></pre>
|
3683
|
+
</td>
|
3684
|
+
</tr>
|
3685
|
+
</table>
|
3686
|
+
</div>
|
3687
|
+
|
3688
|
+
<div class="method_details ">
|
3689
|
+
<h3 class="signature " id="worker!-instance_method">
|
3690
|
+
|
3691
|
+
#<strong>worker!</strong> ⇒ <tt>true</tt>
|
3692
|
+
|
3693
|
+
|
3694
|
+
|
3695
|
+
|
3696
|
+
|
3697
|
+
</h3><div class="docstring">
|
3698
|
+
<div class="discussion">
|
3699
|
+
|
3700
|
+
<p>set the <code>type</code> to :worker, the <code>icon</code> to
|
3701
|
+
'├┤', the <code>color</code> to color: BLUE, the <code>age</code>
|
3702
|
+
to 0, and flags the tile to be updated by the <code>Console</code></p>
|
3703
|
+
|
3704
|
+
|
3705
|
+
</div>
|
3706
|
+
</div>
|
3707
|
+
<div class="tags">
|
3708
|
+
<p class="tag_title">Parameters:</p>
|
3709
|
+
<ul class="param">
|
3710
|
+
|
3711
|
+
<li>
|
3712
|
+
|
3713
|
+
<span class='name'>age</span>
|
3714
|
+
|
3715
|
+
|
3716
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
3717
|
+
|
3718
|
+
|
3719
|
+
|
3720
|
+
</li>
|
3721
|
+
|
3722
|
+
</ul>
|
3723
|
+
|
3724
|
+
<p class="tag_title">Returns:</p>
|
3725
|
+
<ul class="return">
|
3726
|
+
|
3727
|
+
<li>
|
3728
|
+
|
3729
|
+
|
3730
|
+
<span class='type'>(<tt>true</tt>)</span>
|
3731
|
+
|
3732
|
+
|
3733
|
+
|
3734
|
+
</li>
|
3735
|
+
|
3736
|
+
</ul>
|
3737
|
+
|
3738
|
+
</div><table class="source_code">
|
3739
|
+
<tr>
|
3740
|
+
<td>
|
3741
|
+
<pre class="lines">
|
3742
|
+
|
3743
|
+
|
3744
|
+
51</pre>
|
3745
|
+
</td>
|
3746
|
+
<td>
|
3747
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 51</span>
|
3748
|
+
|
3749
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:worker</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>├┤</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#BLUE-constant" title="Swarm::Console::Color::BLUE (constant)">BLUE</a></span></span></pre>
|
3750
|
+
</td>
|
3751
|
+
</tr>
|
3752
|
+
</table>
|
3753
|
+
</div>
|
3754
|
+
|
3755
|
+
<div class="method_details ">
|
3756
|
+
<h3 class="signature " id="worker?-instance_method">
|
3757
|
+
|
3758
|
+
#<strong>worker?</strong> ⇒ <tt>Boolean</tt>
|
3759
|
+
|
3760
|
+
|
3761
|
+
|
3762
|
+
|
3763
|
+
|
3764
|
+
</h3><div class="docstring">
|
3765
|
+
<div class="discussion">
|
3766
|
+
|
3767
|
+
<p>test the value of <code>type</code></p>
|
3768
|
+
|
3769
|
+
|
3770
|
+
</div>
|
3771
|
+
</div>
|
3772
|
+
<div class="tags">
|
3773
|
+
|
3774
|
+
<p class="tag_title">Returns:</p>
|
3775
|
+
<ul class="return">
|
3776
|
+
|
3777
|
+
<li>
|
3778
|
+
|
3779
|
+
|
3780
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
3781
|
+
|
3782
|
+
|
3783
|
+
|
3784
|
+
—
|
3785
|
+
<div class='inline'>
|
3786
|
+
<p><code>true</code> if <code>type</code> is worker, <code>false</code> if it
|
3787
|
+
is not</p>
|
3788
|
+
</div>
|
3789
|
+
|
3790
|
+
</li>
|
3791
|
+
|
3792
|
+
</ul>
|
3793
|
+
|
3794
|
+
</div><table class="source_code">
|
3795
|
+
<tr>
|
3796
|
+
<td>
|
3797
|
+
<pre class="lines">
|
3798
|
+
|
3799
|
+
|
3800
|
+
51</pre>
|
3801
|
+
</td>
|
3802
|
+
<td>
|
3803
|
+
<pre class="code"><span class="info file"># File 'lib/swarm/tile.rb', line 51</span>
|
3804
|
+
|
3805
|
+
<span class='id identifier rubyid_attr_type'>attr_type</span> <span class='symbol'>:worker</span><span class='comma'>,</span> <span class='label'>icon:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>├┤</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span><span class='comma'>,</span> <span class='label'>color:</span> <span class='const'><span class='object_link'><a href="Console/Color.html#BLUE-constant" title="Swarm::Console::Color::BLUE (constant)">BLUE</a></span></span></pre>
|
3806
|
+
</td>
|
3807
|
+
</tr>
|
3808
|
+
</table>
|
3809
|
+
</div>
|
3810
|
+
|
3811
|
+
</div>
|
3812
|
+
|
3813
|
+
</div>
|
3814
|
+
|
3815
|
+
<div id="footer">
|
3816
|
+
Generated on Wed Aug 30 07:17:59 2017 by
|
3817
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
3818
|
+
0.9.9 (ruby-2.4.1).
|
3819
|
+
</div>
|
3820
|
+
|
3821
|
+
</div>
|
3822
|
+
</body>
|
3823
|
+
</html>
|