zig 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/Gemfile +2 -0
- data/LICENSE.txt +22 -0
- data/README.md +21 -0
- data/Rakefile +8 -0
- data/bin/format +12 -0
- data/data/example.json +830 -0
- data/data/example.zig +676 -0
- data/lib/zig.rb +21 -0
- data/lib/zig/formatter.rb +45 -0
- data/lib/zig/lines.rb +17 -0
- data/lib/zig/parser.rb +48 -0
- data/lib/zig/version.rb +3 -0
- data/test/zig_test.rb +164 -0
- data/zig.gemspec +19 -0
- metadata +62 -0
data/data/example.zig
ADDED
@@ -0,0 +1,676 @@
|
|
1
|
+
{
|
2
|
+
items: [
|
3
|
+
{
|
4
|
+
type: 'Farm'
|
5
|
+
level: 1
|
6
|
+
x: 40
|
7
|
+
y: 54
|
8
|
+
damage: 0
|
9
|
+
contracts: {
|
10
|
+
production: {
|
11
|
+
owner: 'Farm'
|
12
|
+
level: -1
|
13
|
+
type: 'production'
|
14
|
+
requirements: {
|
15
|
+
user_level: 1
|
16
|
+
costs: {
|
17
|
+
deposits: {
|
18
|
+
gold: 10
|
19
|
+
duration: 5
|
20
|
+
option: 0
|
21
|
+
product: 'Pumpkin'
|
22
|
+
finished_at: 1347615487
|
23
|
+
energy_used: 0
|
24
|
+
rewards: {
|
25
|
+
food: 15
|
26
|
+
{
|
27
|
+
type: 'House'
|
28
|
+
level: 1
|
29
|
+
x: 47
|
30
|
+
y: 52
|
31
|
+
description: "
|
32
|
+
The nearest market town is Mansle, which can be reached
|
33
|
+
within 10 minutes (11kms) where the local produce market is on twice
|
34
|
+
weekly. In the town, there are 2 main supermarkets, several bars,
|
35
|
+
restaurants, office de tourism, hotel, horse race course, camping site,
|
36
|
+
chemist and bakery.
|
37
|
+
{
|
38
|
+
type: 'House'
|
39
|
+
level: 1
|
40
|
+
x: 53
|
41
|
+
y: 47
|
42
|
+
damage: 0
|
43
|
+
contracts: {
|
44
|
+
production: {
|
45
|
+
owner: 'House'
|
46
|
+
level: 1
|
47
|
+
type: 'production'
|
48
|
+
costs: {
|
49
|
+
deposits: {
|
50
|
+
food: 5
|
51
|
+
duration: 5
|
52
|
+
finished_at: 1347615490
|
53
|
+
energy_used: 0
|
54
|
+
rewards: {
|
55
|
+
gold: 30
|
56
|
+
{
|
57
|
+
type: 'Academy'
|
58
|
+
level: 0
|
59
|
+
x: 73
|
60
|
+
y: 45
|
61
|
+
damage: 0
|
62
|
+
contracts: {
|
63
|
+
upgrade: {
|
64
|
+
owner: 'Academy'
|
65
|
+
level: 0
|
66
|
+
type: 'upgrade'
|
67
|
+
asset_id: 'ConstructionSite'
|
68
|
+
costs: {
|
69
|
+
deposits: {
|
70
|
+
wood: 1000
|
71
|
+
duration: 2
|
72
|
+
energy: 4
|
73
|
+
remainders: {
|
74
|
+
sword: 3
|
75
|
+
helmet: 3
|
76
|
+
training_dummy: 3
|
77
|
+
requirements: {
|
78
|
+
user_level: 8
|
79
|
+
townhall_level: 2
|
80
|
+
finished_at: 1
|
81
|
+
energy_used: 0
|
82
|
+
rewards: {
|
83
|
+
decoration_boost: 0
|
84
|
+
{
|
85
|
+
type: 'Barracks'
|
86
|
+
level: 0
|
87
|
+
x: 64
|
88
|
+
y: 52
|
89
|
+
damage: 0
|
90
|
+
contracts: {
|
91
|
+
upgrade: {
|
92
|
+
owner: 'Barracks'
|
93
|
+
level: 0
|
94
|
+
type: 'upgrade'
|
95
|
+
asset_id: 'ConstructionSite'
|
96
|
+
costs: {
|
97
|
+
deposits: {
|
98
|
+
wood: 100
|
99
|
+
duration: 2
|
100
|
+
energy: 4
|
101
|
+
remainders: {
|
102
|
+
sword: 3
|
103
|
+
helmet: 3
|
104
|
+
training_dummy: 3
|
105
|
+
requirements: {
|
106
|
+
user_level: 1
|
107
|
+
townhall_level: 1
|
108
|
+
finished_at: 1
|
109
|
+
energy_used: 0
|
110
|
+
rewards: {
|
111
|
+
decoration_boost: 0
|
112
|
+
{
|
113
|
+
type: 'Barracks'
|
114
|
+
level: 0
|
115
|
+
x: 24
|
116
|
+
y: 44
|
117
|
+
damage: 0
|
118
|
+
contracts: {
|
119
|
+
upgrade: {
|
120
|
+
owner: 'Barracks'
|
121
|
+
level: 0
|
122
|
+
type: 'upgrade'
|
123
|
+
asset_id: 'ConstructionSite'
|
124
|
+
costs: {
|
125
|
+
deposits: {
|
126
|
+
wood: 2000
|
127
|
+
duration: 2
|
128
|
+
energy: 4
|
129
|
+
remainders: {
|
130
|
+
sword: 3
|
131
|
+
helmet: 3
|
132
|
+
training_dummy: 3
|
133
|
+
requirements: {
|
134
|
+
user_level: 20
|
135
|
+
townhall_level: 3
|
136
|
+
finished_at: 1
|
137
|
+
energy_used: 0
|
138
|
+
rewards: {
|
139
|
+
decoration_boost: 0
|
140
|
+
{
|
141
|
+
type: 'Lumbermill'
|
142
|
+
level: 0
|
143
|
+
x: 82
|
144
|
+
y: 75
|
145
|
+
damage: 0
|
146
|
+
contracts: {
|
147
|
+
upgrade: {
|
148
|
+
owner: 'Lumbermill'
|
149
|
+
level: 0
|
150
|
+
type: 'upgrade'
|
151
|
+
asset_id: 'ConstructionSite'
|
152
|
+
costs: {
|
153
|
+
deposits: {
|
154
|
+
wood: 50
|
155
|
+
duration: 2
|
156
|
+
energy: 4
|
157
|
+
remainders: {
|
158
|
+
shovel: 3
|
159
|
+
saw: 3
|
160
|
+
pickaxe: 3
|
161
|
+
requirements: {
|
162
|
+
user_level: 1
|
163
|
+
townhall_level: 1
|
164
|
+
finished_at: 1
|
165
|
+
energy_used: 0
|
166
|
+
rewards: {
|
167
|
+
decoration_boost: 0
|
168
|
+
{
|
169
|
+
type: 'Lumbermill'
|
170
|
+
level: 0
|
171
|
+
x: 65
|
172
|
+
y: 40
|
173
|
+
damage: 0
|
174
|
+
contracts: {
|
175
|
+
upgrade: {
|
176
|
+
owner: 'Lumbermill'
|
177
|
+
level: 0
|
178
|
+
type: 'upgrade'
|
179
|
+
asset_id: 'ConstructionSite'
|
180
|
+
costs: {
|
181
|
+
deposits: {
|
182
|
+
wood: 50
|
183
|
+
duration: 2
|
184
|
+
energy: 4
|
185
|
+
remainders: {
|
186
|
+
shovel: 3
|
187
|
+
saw: 3
|
188
|
+
pickaxe: 3
|
189
|
+
requirements: {
|
190
|
+
user_level: 1
|
191
|
+
townhall_level: 1
|
192
|
+
finished_at: 1
|
193
|
+
energy_used: 0
|
194
|
+
rewards: {
|
195
|
+
decoration_boost: 0
|
196
|
+
{
|
197
|
+
type: 'Lumbermill'
|
198
|
+
level: 0
|
199
|
+
x: 32
|
200
|
+
y: 64
|
201
|
+
damage: 0
|
202
|
+
contracts: {
|
203
|
+
upgrade: {
|
204
|
+
owner: 'Lumbermill'
|
205
|
+
level: 0
|
206
|
+
type: 'upgrade'
|
207
|
+
asset_id: 'ConstructionSite'
|
208
|
+
costs: {
|
209
|
+
deposits: {
|
210
|
+
wood: 50
|
211
|
+
duration: 2
|
212
|
+
energy: 4
|
213
|
+
remainders: {
|
214
|
+
shovel: 3
|
215
|
+
saw: 3
|
216
|
+
pickaxe: 3
|
217
|
+
requirements: {
|
218
|
+
user_level: 1
|
219
|
+
townhall_level: 1
|
220
|
+
finished_at: 1
|
221
|
+
energy_used: 0
|
222
|
+
rewards: {
|
223
|
+
decoration_boost: 0
|
224
|
+
{
|
225
|
+
type: 'Quarry'
|
226
|
+
level: 0
|
227
|
+
x: 44
|
228
|
+
y: 74
|
229
|
+
damage: 0
|
230
|
+
contracts: {
|
231
|
+
upgrade: {
|
232
|
+
owner: 'Quarry'
|
233
|
+
level: 0
|
234
|
+
type: 'upgrade'
|
235
|
+
asset_id: 'ConstructionSite'
|
236
|
+
costs: {
|
237
|
+
deposits: {
|
238
|
+
wood: 50
|
239
|
+
duration: 2
|
240
|
+
energy: 4
|
241
|
+
remainders: {
|
242
|
+
shovel: 3
|
243
|
+
saw: 3
|
244
|
+
pickaxe: 3
|
245
|
+
requirements: {
|
246
|
+
user_level: 1
|
247
|
+
townhall_level: 1
|
248
|
+
finished_at: 1
|
249
|
+
energy_used: 0
|
250
|
+
rewards: {
|
251
|
+
decoration_boost: 0
|
252
|
+
{
|
253
|
+
type: 'Quarry'
|
254
|
+
level: 0
|
255
|
+
x: 74
|
256
|
+
y: 13
|
257
|
+
damage: 0
|
258
|
+
contracts: {
|
259
|
+
upgrade: {
|
260
|
+
owner: 'Quarry'
|
261
|
+
level: 0
|
262
|
+
type: 'upgrade'
|
263
|
+
asset_id: 'ConstructionSite'
|
264
|
+
costs: {
|
265
|
+
deposits: {
|
266
|
+
wood: 50
|
267
|
+
duration: 2
|
268
|
+
energy: 4
|
269
|
+
remainders: {
|
270
|
+
shovel: 3
|
271
|
+
saw: 3
|
272
|
+
pickaxe: 3
|
273
|
+
requirements: {
|
274
|
+
user_level: 1
|
275
|
+
townhall_level: 1
|
276
|
+
finished_at: 1
|
277
|
+
energy_used: 0
|
278
|
+
rewards: {
|
279
|
+
decoration_boost: 0
|
280
|
+
{
|
281
|
+
type: 'Quarry'
|
282
|
+
level: 0
|
283
|
+
x: 35
|
284
|
+
y: 32
|
285
|
+
damage: 0
|
286
|
+
contracts: {
|
287
|
+
upgrade: {
|
288
|
+
owner: 'Quarry'
|
289
|
+
level: 0
|
290
|
+
type: 'upgrade'
|
291
|
+
asset_id: 'ConstructionSite'
|
292
|
+
costs: {
|
293
|
+
deposits: {
|
294
|
+
wood: 50
|
295
|
+
duration: 2
|
296
|
+
energy: 4
|
297
|
+
remainders: {
|
298
|
+
shovel: 3
|
299
|
+
saw: 3
|
300
|
+
pickaxe: 3
|
301
|
+
requirements: {
|
302
|
+
user_level: 1
|
303
|
+
townhall_level: 1
|
304
|
+
finished_at: 1
|
305
|
+
energy_used: 0
|
306
|
+
rewards: {
|
307
|
+
decoration_boost: 0
|
308
|
+
{
|
309
|
+
type: 'Quarry'
|
310
|
+
level: 0
|
311
|
+
x: 14
|
312
|
+
y: 23
|
313
|
+
damage: 0
|
314
|
+
contracts: {
|
315
|
+
upgrade: {
|
316
|
+
owner: 'Quarry'
|
317
|
+
level: 0
|
318
|
+
type: 'upgrade'
|
319
|
+
asset_id: 'ConstructionSite'
|
320
|
+
costs: {
|
321
|
+
deposits: {
|
322
|
+
wood: 50
|
323
|
+
duration: 2
|
324
|
+
energy: 4
|
325
|
+
remainders: {
|
326
|
+
shovel: 3
|
327
|
+
saw: 3
|
328
|
+
pickaxe: 3
|
329
|
+
requirements: {
|
330
|
+
user_level: 1
|
331
|
+
townhall_level: 1
|
332
|
+
finished_at: 1
|
333
|
+
energy_used: 0
|
334
|
+
rewards: {
|
335
|
+
decoration_boost: 0
|
336
|
+
{
|
337
|
+
type: 'Townhall'
|
338
|
+
level: 1
|
339
|
+
x: 47
|
340
|
+
y: 44
|
341
|
+
{
|
342
|
+
type: 'House'
|
343
|
+
level: 1
|
344
|
+
x: 51
|
345
|
+
y: 64
|
346
|
+
{
|
347
|
+
type: 'Wall'
|
348
|
+
level: 1
|
349
|
+
x: 57
|
350
|
+
y: 47
|
351
|
+
{
|
352
|
+
type: 'Wall'
|
353
|
+
level: 1
|
354
|
+
x: 58
|
355
|
+
y: 47
|
356
|
+
{
|
357
|
+
type: 'Wall'
|
358
|
+
level: 1
|
359
|
+
x: 59
|
360
|
+
y: 47
|
361
|
+
{
|
362
|
+
type: 'Wall'
|
363
|
+
level: 1
|
364
|
+
x: 59
|
365
|
+
y: 48
|
366
|
+
{
|
367
|
+
type: 'Wall'
|
368
|
+
level: 1
|
369
|
+
x: 59
|
370
|
+
y: 49
|
371
|
+
{
|
372
|
+
type: 'Road'
|
373
|
+
x: 44
|
374
|
+
y: 50
|
375
|
+
{
|
376
|
+
type: 'Road'
|
377
|
+
x: 46
|
378
|
+
y: 50
|
379
|
+
{
|
380
|
+
type: 'Road'
|
381
|
+
x: 48
|
382
|
+
y: 50
|
383
|
+
{
|
384
|
+
type: 'Road'
|
385
|
+
x: 50
|
386
|
+
y: 50
|
387
|
+
{
|
388
|
+
type: 'Road'
|
389
|
+
x: 52
|
390
|
+
y: 50
|
391
|
+
{
|
392
|
+
type: 'Road'
|
393
|
+
x: 54
|
394
|
+
y: 50
|
395
|
+
{
|
396
|
+
type: 'Road'
|
397
|
+
x: 56
|
398
|
+
y: 50
|
399
|
+
{
|
400
|
+
type: 'Road'
|
401
|
+
x: 58
|
402
|
+
y: 50
|
403
|
+
{
|
404
|
+
type: 'Road'
|
405
|
+
x: 60
|
406
|
+
y: 50
|
407
|
+
{
|
408
|
+
type: 'Road'
|
409
|
+
x: 62
|
410
|
+
y: 50
|
411
|
+
{
|
412
|
+
type: 'Road'
|
413
|
+
x: 64
|
414
|
+
y: 50
|
415
|
+
{
|
416
|
+
type: 'Road'
|
417
|
+
x: 66
|
418
|
+
y: 50
|
419
|
+
{
|
420
|
+
type: 'Road'
|
421
|
+
x: 68
|
422
|
+
y: 50
|
423
|
+
{
|
424
|
+
type: 'Road'
|
425
|
+
x: 70
|
426
|
+
y: 50
|
427
|
+
{
|
428
|
+
type: 'Road'
|
429
|
+
x: 72
|
430
|
+
y: 50
|
431
|
+
{
|
432
|
+
type: 'Road'
|
433
|
+
x: 74
|
434
|
+
y: 50
|
435
|
+
{
|
436
|
+
type: 'Road'
|
437
|
+
x: 76
|
438
|
+
y: 50
|
439
|
+
{
|
440
|
+
type: 'Road'
|
441
|
+
x: 78
|
442
|
+
y: 50
|
443
|
+
{
|
444
|
+
type: 'Road'
|
445
|
+
x: 80
|
446
|
+
y: 50
|
447
|
+
{
|
448
|
+
type: 'Road'
|
449
|
+
x: 82
|
450
|
+
y: 50
|
451
|
+
{
|
452
|
+
type: 'Road'
|
453
|
+
x: 84
|
454
|
+
y: 50
|
455
|
+
{
|
456
|
+
type: 'Road'
|
457
|
+
x: 86
|
458
|
+
y: 50
|
459
|
+
{
|
460
|
+
type: 'Road'
|
461
|
+
x: 88
|
462
|
+
y: 50
|
463
|
+
{
|
464
|
+
type: 'Road'
|
465
|
+
x: 54
|
466
|
+
y: 52
|
467
|
+
{
|
468
|
+
type: 'Wall'
|
469
|
+
level: 1
|
470
|
+
x: 56
|
471
|
+
y: 52
|
472
|
+
{
|
473
|
+
type: 'Road'
|
474
|
+
x: 88
|
475
|
+
y: 52
|
476
|
+
{
|
477
|
+
type: 'Wall'
|
478
|
+
level: 1
|
479
|
+
x: 56
|
480
|
+
y: 53
|
481
|
+
{
|
482
|
+
type: 'Road'
|
483
|
+
x: 88
|
484
|
+
y: 53
|
485
|
+
{
|
486
|
+
type: 'Road'
|
487
|
+
x: 90
|
488
|
+
y: 53
|
489
|
+
{
|
490
|
+
type: 'Road'
|
491
|
+
x: 92
|
492
|
+
y: 53
|
493
|
+
{
|
494
|
+
type: 'Road'
|
495
|
+
x: 94
|
496
|
+
y: 53
|
497
|
+
{
|
498
|
+
type: 'Road'
|
499
|
+
x: 96
|
500
|
+
y: 53
|
501
|
+
{
|
502
|
+
type: 'Road'
|
503
|
+
x: 98
|
504
|
+
y: 53
|
505
|
+
{
|
506
|
+
type: 'Road'
|
507
|
+
x: 54
|
508
|
+
y: 54
|
509
|
+
{
|
510
|
+
type: 'Wall'
|
511
|
+
level: 1
|
512
|
+
x: 56
|
513
|
+
y: 54
|
514
|
+
{
|
515
|
+
type: 'Wall'
|
516
|
+
level: 1
|
517
|
+
x: 57
|
518
|
+
y: 54
|
519
|
+
{
|
520
|
+
type: 'Road'
|
521
|
+
x: 54
|
522
|
+
y: 56
|
523
|
+
{
|
524
|
+
type: 'Road'
|
525
|
+
x: 54
|
526
|
+
y: 62
|
527
|
+
{
|
528
|
+
type: 'Road'
|
529
|
+
x: 54
|
530
|
+
y: 64
|
531
|
+
{
|
532
|
+
type: 'Wall'
|
533
|
+
level: 1
|
534
|
+
x: 66
|
535
|
+
y: 67
|
536
|
+
{
|
537
|
+
type: 'Wall'
|
538
|
+
level: 1
|
539
|
+
x: 64
|
540
|
+
y: 68
|
541
|
+
{
|
542
|
+
type: 'Wall'
|
543
|
+
level: 1
|
544
|
+
x: 65
|
545
|
+
y: 68
|
546
|
+
{
|
547
|
+
type: 'Wall'
|
548
|
+
level: 1
|
549
|
+
x: 66
|
550
|
+
y: 68
|
551
|
+
{
|
552
|
+
type: 'Port'
|
553
|
+
level: 1
|
554
|
+
x: 54
|
555
|
+
y: 81
|
556
|
+
map_expansions: [
|
557
|
+
[
|
558
|
+
0
|
559
|
+
0
|
560
|
+
0
|
561
|
+
0
|
562
|
+
0
|
563
|
+
0
|
564
|
+
0
|
565
|
+
0
|
566
|
+
[
|
567
|
+
0
|
568
|
+
0
|
569
|
+
0
|
570
|
+
0
|
571
|
+
0
|
572
|
+
0
|
573
|
+
0
|
574
|
+
0
|
575
|
+
[
|
576
|
+
0
|
577
|
+
0
|
578
|
+
0
|
579
|
+
0
|
580
|
+
0
|
581
|
+
0
|
582
|
+
0
|
583
|
+
0
|
584
|
+
[
|
585
|
+
0
|
586
|
+
0
|
587
|
+
0
|
588
|
+
1
|
589
|
+
1
|
590
|
+
0
|
591
|
+
0
|
592
|
+
0
|
593
|
+
[
|
594
|
+
0
|
595
|
+
0
|
596
|
+
0
|
597
|
+
1
|
598
|
+
1
|
599
|
+
0
|
600
|
+
0
|
601
|
+
0
|
602
|
+
[
|
603
|
+
0
|
604
|
+
0
|
605
|
+
0
|
606
|
+
0
|
607
|
+
0
|
608
|
+
0
|
609
|
+
0
|
610
|
+
0
|
611
|
+
[
|
612
|
+
0
|
613
|
+
0
|
614
|
+
0
|
615
|
+
0
|
616
|
+
0
|
617
|
+
0
|
618
|
+
0
|
619
|
+
0
|
620
|
+
[
|
621
|
+
0
|
622
|
+
0
|
623
|
+
0
|
624
|
+
0
|
625
|
+
0
|
626
|
+
0
|
627
|
+
0
|
628
|
+
0
|
629
|
+
resources: {
|
630
|
+
gold: 200
|
631
|
+
food: 200
|
632
|
+
wood: 200
|
633
|
+
stone: 0
|
634
|
+
xp: 0
|
635
|
+
shovel: 1000
|
636
|
+
wheelbarrow: 1000
|
637
|
+
saw: 1000
|
638
|
+
pickaxe: 1000
|
639
|
+
rope: 1000
|
640
|
+
wheel: 1000
|
641
|
+
candle: 1000
|
642
|
+
beer_barrel: 1000
|
643
|
+
oak_door: 1000
|
644
|
+
goblet: 1000
|
645
|
+
mirror: 1000
|
646
|
+
tapestry: 1000
|
647
|
+
painting: 1000
|
648
|
+
marble_pillar: 1000
|
649
|
+
marble_statue: 1000
|
650
|
+
bread_loaf: 1000
|
651
|
+
beef_stew: 1000
|
652
|
+
leg_of_mutton: 1000
|
653
|
+
roasted_chicken: 1000
|
654
|
+
shield: 1000
|
655
|
+
sword: 1000
|
656
|
+
helmet: 1000
|
657
|
+
training_dummy: 1000
|
658
|
+
horseshoe: 1000
|
659
|
+
saddle: 1000
|
660
|
+
jousting_lance: 1000
|
661
|
+
arrow: 1000
|
662
|
+
bow: 1000
|
663
|
+
archery_target: 1000
|
664
|
+
royal_seal: 10
|
665
|
+
land_deed: 1000
|
666
|
+
spyglass: 1000
|
667
|
+
compass: 1000
|
668
|
+
quill_pen: 1000
|
669
|
+
map: 1000
|
670
|
+
parchment: 1000
|
671
|
+
carrier_pigeon: 1000
|
672
|
+
units: [
|
673
|
+
{
|
674
|
+
amount: 10
|
675
|
+
level: 1
|
676
|
+
type: 'Peasant'
|