sashite-ggn 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +523 -521
  3. data/VERSION.semver +1 -1
  4. data/lib/sashite/ggn.rb +3 -2
  5. data/lib/sashite/ggn/ability.rb +11 -19
  6. data/lib/sashite/ggn/actor.rb +5 -13
  7. data/lib/sashite/ggn/ally.rb +6 -14
  8. data/lib/sashite/ggn/area.rb +6 -14
  9. data/lib/sashite/ggn/attacked.rb +6 -14
  10. data/lib/sashite/ggn/boolean.rb +6 -14
  11. data/lib/sashite/ggn/digit.rb +6 -14
  12. data/lib/sashite/ggn/digit_excluding_zero.rb +6 -14
  13. data/lib/sashite/ggn/direction.rb +6 -14
  14. data/lib/sashite/ggn/gameplay.rb +8 -28
  15. data/lib/sashite/ggn/gameplay_into_base64.rb +7 -14
  16. data/lib/sashite/ggn/integer.rb +6 -14
  17. data/lib/sashite/ggn/last_moved_actor.rb +6 -14
  18. data/lib/sashite/ggn/maximum_magnitude.rb +6 -14
  19. data/lib/sashite/ggn/name.rb +6 -14
  20. data/lib/sashite/ggn/negative_integer.rb +6 -14
  21. data/lib/sashite/ggn/null.rb +7 -9
  22. data/lib/sashite/ggn/object.rb +11 -19
  23. data/lib/sashite/ggn/occupied.rb +12 -20
  24. data/lib/sashite/ggn/pattern.rb +7 -16
  25. data/lib/sashite/ggn/previous_moves_counter.rb +6 -14
  26. data/lib/sashite/ggn/promotable_into_actors.rb +8 -17
  27. data/lib/sashite/ggn/required.rb +6 -14
  28. data/lib/sashite/ggn/self.rb +7 -9
  29. data/lib/sashite/ggn/square.rb +11 -19
  30. data/lib/sashite/ggn/state.rb +9 -17
  31. data/lib/sashite/ggn/subject.rb +11 -19
  32. data/lib/sashite/ggn/unsigned_integer.rb +6 -14
  33. data/lib/sashite/ggn/unsigned_integer_excluding_zero.rb +5 -13
  34. data/lib/sashite/ggn/verb.rb +15 -24
  35. data/lib/sashite/ggn/zero.rb +7 -9
  36. data/sashite-ggn.gemspec +2 -4
  37. data/test/test_ggn.rb +501 -495
  38. data/test/test_ggn_ability.rb +10 -10
  39. data/test/test_ggn_actor.rb +516 -536
  40. data/test/test_ggn_ally.rb +13 -29
  41. data/test/test_ggn_area.rb +9 -67
  42. data/test/test_ggn_attacked.rb +13 -29
  43. data/test/test_ggn_boolean.rb +10 -26
  44. data/test/test_ggn_digit.rb +10 -10
  45. data/test/test_ggn_digit_excluding_zero.rb +10 -11
  46. data/test/test_ggn_direction.rb +10 -10
  47. data/test/test_ggn_gameplay.rb +22 -38
  48. data/test/test_ggn_gameplay_into_base64.rb +511 -501
  49. data/test/test_ggn_integer.rb +19 -21
  50. data/test/test_ggn_last_moved_actor.rb +13 -29
  51. data/test/test_ggn_maximum_magnitude.rb +18 -16
  52. data/test/test_ggn_name.rb +9 -39
  53. data/test/test_ggn_negative_integer.rb +10 -10
  54. data/test/test_ggn_null.rb +10 -10
  55. data/test/test_ggn_object.rb +22 -24
  56. data/test/test_ggn_occupied.rb +40 -64
  57. data/test/test_ggn_pattern.rb +12 -10
  58. data/test/test_ggn_previous_moves_counter.rb +18 -20
  59. data/test/test_ggn_promotable_into_actors.rb +529 -549
  60. data/test/test_ggn_required.rb +10 -26
  61. data/test/test_ggn_self.rb +10 -10
  62. data/test/test_ggn_square.rb +14 -16
  63. data/test/test_ggn_state.rb +15 -19
  64. data/test/test_ggn_subject.rb +17 -19
  65. data/test/test_ggn_unsigned_integer.rb +30 -12
  66. data/test/test_ggn_unsigned_integer_excluding_zero.rb +14 -10
  67. data/test/test_ggn_verb.rb +16 -15
  68. data/test/test_ggn_zero.rb +10 -10
  69. metadata +4 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d56341d1394c220628569276f96dae65030b09a2
4
- data.tar.gz: 38d100bd971288c6118308398dfc7c00f4537507
3
+ metadata.gz: cc3e41d95a692971ccd464ef45040baa3766c3e1
4
+ data.tar.gz: c8511f5a3bfb0cba38e55abc1c1bafee472413f3
5
5
  SHA512:
6
- metadata.gz: 107e54756a40b47831976053068b164beec23602cc969f4b821a32ebc3ebd620cc28a80afa312a55fb35b6029bf017cd9da6eb6e5c463756f11f6b4592f5b2fd
7
- data.tar.gz: 70742aab97dc8d75041273401f4f5a8f87f29c4328d0c401747c9fd367365cd765da7e48bcb42d11ce1e690d13f8fa51061e02927022cfb1e005e1719fb1ac66
6
+ metadata.gz: 7e3014d5a5675cab389d9bacd3d49cccacbd06bf98e08740fa0f7f26449409d04ab865791e119399313752ebeed730a99d93a3b42cec464d7a4922d4e52b2b2c
7
+ data.tar.gz: 417a0c0899ee74e1182cf15cb18f441608bbddfebcc3b23aa556a170932b864d6834ccaf6023b04c87887d60196bb7cbb3e6e4be8d4b2b0e6430562d858d7a9b
data/README.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # Sashite::GGN
2
2
 
3
- This module provides a Ruby interface for gameplay serialization in [GGN](http://sashite.wiki/General_Gameplay_Notation) format.
3
+ This module provides a Ruby interface for data serialization in [GGN](http://sashite.wiki/General_Gameplay_Notation) format.
4
4
 
5
5
  ## Status
6
6
 
7
- [![Gem Version](https://badge.fury.io/rb/sashite-ggn.svg)](//badge.fury.io/rb/sashite-ggn)
8
- [![Build Status](https://secure.travis-ci.org/sashite/ggn.rb.svg?branch=master)](//travis-ci.org/sashite/ggn.rb?branch=master)
7
+ * [![Gem Version](https://badge.fury.io/rb/sashite-ggn.svg)](//badge.fury.io/rb/sashite-ggn)
8
+ * [![Build Status](https://secure.travis-ci.org/sashite/ggn.rb.svg?branch=master)](//travis-ci.org/sashite/ggn.rb?branch=master)
9
+ * [![Dependency Status](https://gemnasium.com/sashite/ggn.rb.svg)](//gemnasium.com/sashite/ggn.rb)
9
10
 
10
11
  ## Installation
11
12
 
@@ -23,539 +24,540 @@ Or install it yourself as:
23
24
 
24
25
  ## Usage
25
26
 
26
- require 'sashite-ggn'
27
-
28
- arr = [
29
- [
30
- {
31
- :"subject" => {
32
- :"...ally?" => true,
33
- :"actor" => :self,
34
- :"state" => {
35
- :"...last_moved_actor?" => nil,
36
- :"...previous_moves_counter" => nil
37
- }
38
- },
39
-
40
- :"verb" => {
41
- :"name" => :remove,
42
- :"vector" => {:"...maximum_magnitude" => 1, direction: [-1,0]}
43
- },
44
-
45
- :"object" => {
46
- :"src_square" => {
47
- :"...attacked?" => nil,
48
- :"...occupied!" => false,
49
- :"area" => :all
50
- },
51
- :"dst_square" => {
52
- :"...attacked?" => nil,
53
- :"...occupied!" => :an_enemy_actor,
54
- :"area" => :all
55
- },
56
- :"promotable_into_actors" => [:self]
57
- }
27
+ Working with GGN can be very simple, for example:
28
+
29
+ ```ruby
30
+ require 'sashite-ggn'
31
+
32
+ # Parse a GGN string
33
+
34
+ ggn_obj = [
35
+ [
36
+ {
37
+ :"subject" => {
38
+ :"...ally?" => true,
39
+ :"actor" => :self,
40
+ :"state" => {
41
+ :"...last_moved_actor?" => nil,
42
+ :"...previous_moves_counter" => nil
58
43
  }
59
- ],
60
-
61
-
62
-
63
- [
64
- {
65
- :"subject" => {
66
- :"...ally?" => true,
67
- :"actor" => :self,
68
- :"state" => {
69
- :"...last_moved_actor?" => nil,
70
- :"...previous_moves_counter" => nil
71
- }
72
- },
73
-
74
- :"verb" => {
75
- :"name" => :remove,
76
- :"vector" => {:"...maximum_magnitude" => 1, direction: [0,-1]}
77
- },
78
-
79
- :"object" => {
80
- :"src_square" => {
81
- :"...attacked?" => nil,
82
- :"...occupied!" => false,
83
- :"area" => :all
84
- },
85
- :"dst_square" => {
86
- :"...attacked?" => nil,
87
- :"...occupied!" => :an_enemy_actor,
88
- :"area" => :all
89
- },
90
- :"promotable_into_actors" => [:self]
91
- }
44
+ },
45
+
46
+ :"verb" => {
47
+ :"name" => :remove,
48
+ :"vector" => {:"...maximum_magnitude" => 1, direction: [-1,0]}
49
+ },
50
+
51
+ :"object" => {
52
+ :"src_square" => {
53
+ :"...attacked?" => nil,
54
+ :"...occupied!" => false,
55
+ :"area" => :all
56
+ },
57
+ :"dst_square" => {
58
+ :"...attacked?" => nil,
59
+ :"...occupied!" => :an_enemy_actor,
60
+ :"area" => :all
61
+ },
62
+ :"promotable_into_actors" => [:self]
63
+ }
64
+ }
65
+ ],
66
+
67
+
68
+
69
+ [
70
+ {
71
+ :"subject" => {
72
+ :"...ally?" => true,
73
+ :"actor" => :self,
74
+ :"state" => {
75
+ :"...last_moved_actor?" => nil,
76
+ :"...previous_moves_counter" => nil
92
77
  }
93
- ],
94
-
95
-
96
-
97
- [
98
- {
99
- :"subject" => {
100
- :"...ally?" => true,
101
- :"actor" => :self,
102
- :"state" => {
103
- :"...last_moved_actor?" => nil,
104
- :"...previous_moves_counter" => nil
105
- }
106
- },
107
-
108
- :"verb" => {
109
- :"name" => :remove,
110
- :"vector" => {:"...maximum_magnitude" => 1, direction: [0,1]}
111
- },
112
-
113
- :"object" => {
114
- :"src_square" => {
115
- :"...attacked?" => nil,
116
- :"...occupied!" => false,
117
- :"area" => :all
118
- },
119
- :"dst_square" => {
120
- :"...attacked?" => nil,
121
- :"...occupied!" => :an_enemy_actor,
122
- :"area" => :all
123
- },
124
- :"promotable_into_actors" => [:self]
125
- }
78
+ },
79
+
80
+ :"verb" => {
81
+ :"name" => :remove,
82
+ :"vector" => {:"...maximum_magnitude" => 1, direction: [0,-1]}
83
+ },
84
+
85
+ :"object" => {
86
+ :"src_square" => {
87
+ :"...attacked?" => nil,
88
+ :"...occupied!" => false,
89
+ :"area" => :all
90
+ },
91
+ :"dst_square" => {
92
+ :"...attacked?" => nil,
93
+ :"...occupied!" => :an_enemy_actor,
94
+ :"area" => :all
95
+ },
96
+ :"promotable_into_actors" => [:self]
97
+ }
98
+ }
99
+ ],
100
+
101
+
102
+
103
+ [
104
+ {
105
+ :"subject" => {
106
+ :"...ally?" => true,
107
+ :"actor" => :self,
108
+ :"state" => {
109
+ :"...last_moved_actor?" => nil,
110
+ :"...previous_moves_counter" => nil
126
111
  }
127
- ],
128
-
129
-
130
-
131
- [
132
- {
133
- :"subject" => {
134
- :"...ally?" => true,
135
- :"actor" => :self,
136
- :"state" => {
137
- :"...last_moved_actor?" => nil,
138
- :"...previous_moves_counter" => nil
139
- }
140
- },
141
-
142
- :"verb" => {
143
- :"name" => :remove,
144
- :"vector" => {:"...maximum_magnitude" => 1, direction: [1,0]}
145
- },
146
-
147
- :"object" => {
148
- :"src_square" => {
149
- :"...attacked?" => nil,
150
- :"...occupied!" => false,
151
- :"area" => :all
152
- },
153
- :"dst_square" => {
154
- :"...attacked?" => nil,
155
- :"...occupied!" => :an_enemy_actor,
156
- :"area" => :all
157
- },
158
- :"promotable_into_actors" => [:self]
159
- }
112
+ },
113
+
114
+ :"verb" => {
115
+ :"name" => :remove,
116
+ :"vector" => {:"...maximum_magnitude" => 1, direction: [0,1]}
117
+ },
118
+
119
+ :"object" => {
120
+ :"src_square" => {
121
+ :"...attacked?" => nil,
122
+ :"...occupied!" => false,
123
+ :"area" => :all
124
+ },
125
+ :"dst_square" => {
126
+ :"...attacked?" => nil,
127
+ :"...occupied!" => :an_enemy_actor,
128
+ :"area" => :all
129
+ },
130
+ :"promotable_into_actors" => [:self]
131
+ }
132
+ }
133
+ ],
134
+
135
+
136
+
137
+ [
138
+ {
139
+ :"subject" => {
140
+ :"...ally?" => true,
141
+ :"actor" => :self,
142
+ :"state" => {
143
+ :"...last_moved_actor?" => nil,
144
+ :"...previous_moves_counter" => nil
160
145
  }
161
- ],
162
-
163
-
164
-
165
- [
166
- {
167
- :"subject" => {
168
- :"...ally?" => true,
169
- :"actor" => :self,
170
- :"state" => {
171
- :"...last_moved_actor?" => nil,
172
- :"...previous_moves_counter" => nil
173
- }
174
- },
175
-
176
- :"verb" => {
177
- :"name" => :shift,
178
- :"vector" => {:"...maximum_magnitude" => nil, direction: [-1,0]}
179
- },
180
-
181
- :"object" => {
182
- :"src_square" => {
183
- :"...attacked?" => nil,
184
- :"...occupied!" => false,
185
- :"area" => :all
186
- },
187
- :"dst_square" => {
188
- :"...attacked?" => nil,
189
- :"...occupied!" => false,
190
- :"area" => :all
191
- },
192
- :"promotable_into_actors" => [:self]
193
- }
146
+ },
147
+
148
+ :"verb" => {
149
+ :"name" => :remove,
150
+ :"vector" => {:"...maximum_magnitude" => 1, direction: [1,0]}
151
+ },
152
+
153
+ :"object" => {
154
+ :"src_square" => {
155
+ :"...attacked?" => nil,
156
+ :"...occupied!" => false,
157
+ :"area" => :all
158
+ },
159
+ :"dst_square" => {
160
+ :"...attacked?" => nil,
161
+ :"...occupied!" => :an_enemy_actor,
162
+ :"area" => :all
163
+ },
164
+ :"promotable_into_actors" => [:self]
165
+ }
166
+ }
167
+ ],
168
+
169
+
170
+
171
+ [
172
+ {
173
+ :"subject" => {
174
+ :"...ally?" => true,
175
+ :"actor" => :self,
176
+ :"state" => {
177
+ :"...last_moved_actor?" => nil,
178
+ :"...previous_moves_counter" => nil
194
179
  }
195
- ],
196
-
197
-
198
-
199
- [
200
- {
201
- :"subject" => {
202
- :"...ally?" => true,
203
- :"actor" => :self,
204
- :"state" => {
205
- :"...last_moved_actor?" => nil,
206
- :"...previous_moves_counter" => nil
207
- }
208
- },
209
-
210
- :"verb" => {
211
- :"name" => :shift,
212
- :"vector" => {:"...maximum_magnitude" => nil, direction: [-1,0]}
213
- },
214
-
215
- :"object" => {
216
- :"src_square" => {
217
- :"...attacked?" => nil,
218
- :"...occupied!" => false,
219
- :"area" => :all
220
- },
221
- :"dst_square" => {
222
- :"...attacked?" => nil,
223
- :"...occupied!" => false,
224
- :"area" => :all
225
- },
226
- :"promotable_into_actors" => [:self]
227
- }
228
- },
229
- {
230
- :"subject" => {
231
- :"...ally?" => true,
232
- :"actor" => :self,
233
- :"state" => {
234
- :"...last_moved_actor?" => nil,
235
- :"...previous_moves_counter" => nil
236
- }
237
- },
238
-
239
- :"verb" => {
240
- :"name" => :remove,
241
- :"vector" => {:"...maximum_magnitude" => 1, direction: [-1,0]}
242
- },
243
-
244
- :"object" => {
245
- :"src_square" => {
246
- :"...attacked?" => nil,
247
- :"...occupied!" => false,
248
- :"area" => :all
249
- },
250
- :"dst_square" => {
251
- :"...attacked?" => nil,
252
- :"...occupied!" => :an_enemy_actor,
253
- :"area" => :all
254
- },
255
- :"promotable_into_actors" => [:self]
256
- }
180
+ },
181
+
182
+ :"verb" => {
183
+ :"name" => :shift,
184
+ :"vector" => {:"...maximum_magnitude" => nil, direction: [-1,0]}
185
+ },
186
+
187
+ :"object" => {
188
+ :"src_square" => {
189
+ :"...attacked?" => nil,
190
+ :"...occupied!" => false,
191
+ :"area" => :all
192
+ },
193
+ :"dst_square" => {
194
+ :"...attacked?" => nil,
195
+ :"...occupied!" => false,
196
+ :"area" => :all
197
+ },
198
+ :"promotable_into_actors" => [:self]
199
+ }
200
+ }
201
+ ],
202
+
203
+
204
+
205
+ [
206
+ {
207
+ :"subject" => {
208
+ :"...ally?" => true,
209
+ :"actor" => :self,
210
+ :"state" => {
211
+ :"...last_moved_actor?" => nil,
212
+ :"...previous_moves_counter" => nil
257
213
  }
258
- ],
259
-
260
-
261
-
262
- [
263
- {
264
- :"subject" => {
265
- :"...ally?" => true,
266
- :"actor" => :self,
267
- :"state" => {
268
- :"...last_moved_actor?" => nil,
269
- :"...previous_moves_counter" => nil
270
- }
271
- },
272
-
273
- :"verb" => {
274
- :"name" => :shift,
275
- :"vector" => {:"...maximum_magnitude" => nil, direction: [0,-1]}
276
- },
277
-
278
- :"object" => {
279
- :"src_square" => {
280
- :"...attacked?" => nil,
281
- :"...occupied!" => false,
282
- :"area" => :all
283
- },
284
- :"dst_square" => {
285
- :"...attacked?" => nil,
286
- :"...occupied!" => false,
287
- :"area" => :all
288
- },
289
- :"promotable_into_actors" => [:self]
290
- }
214
+ },
215
+
216
+ :"verb" => {
217
+ :"name" => :shift,
218
+ :"vector" => {:"...maximum_magnitude" => nil, direction: [-1,0]}
219
+ },
220
+
221
+ :"object" => {
222
+ :"src_square" => {
223
+ :"...attacked?" => nil,
224
+ :"...occupied!" => false,
225
+ :"area" => :all
226
+ },
227
+ :"dst_square" => {
228
+ :"...attacked?" => nil,
229
+ :"...occupied!" => false,
230
+ :"area" => :all
231
+ },
232
+ :"promotable_into_actors" => [:self]
233
+ }
234
+ },
235
+ {
236
+ :"subject" => {
237
+ :"...ally?" => true,
238
+ :"actor" => :self,
239
+ :"state" => {
240
+ :"...last_moved_actor?" => nil,
241
+ :"...previous_moves_counter" => nil
291
242
  }
292
- ],
293
-
294
-
295
-
296
- [
297
- {
298
- :"subject" => {
299
- :"...ally?" => true,
300
- :"actor" => :self,
301
- :"state" => {
302
- :"...last_moved_actor?" => nil,
303
- :"...previous_moves_counter" => nil
304
- }
305
- },
306
-
307
- :"verb" => {
308
- :"name" => :shift,
309
- :"vector" => {:"...maximum_magnitude" => nil, direction: [0,-1]}
310
- },
311
-
312
- :"object" => {
313
- :"src_square" => {
314
- :"...attacked?" => nil,
315
- :"...occupied!" => false,
316
- :"area" => :all
317
- },
318
- :"dst_square" => {
319
- :"...attacked?" => nil,
320
- :"...occupied!" => false,
321
- :"area" => :all
322
- },
323
- :"promotable_into_actors" => [:self]
324
- }
325
- },
326
- {
327
- :"subject" => {
328
- :"...ally?" => true,
329
- :"actor" => :self,
330
- :"state" => {
331
- :"...last_moved_actor?" => nil,
332
- :"...previous_moves_counter" => nil
333
- }
334
- },
335
-
336
- :"verb" => {
337
- :"name" => :remove,
338
- :"vector" => {:"...maximum_magnitude" => 1, direction: [0,-1]}
339
- },
340
-
341
- :"object" => {
342
- :"src_square" => {
343
- :"...attacked?" => nil,
344
- :"...occupied!" => false,
345
- :"area" => :all
346
- },
347
- :"dst_square" => {
348
- :"...attacked?" => nil,
349
- :"...occupied!" => :an_enemy_actor,
350
- :"area" => :all
351
- },
352
- :"promotable_into_actors" => [:self]
353
- }
243
+ },
244
+
245
+ :"verb" => {
246
+ :"name" => :remove,
247
+ :"vector" => {:"...maximum_magnitude" => 1, direction: [-1,0]}
248
+ },
249
+
250
+ :"object" => {
251
+ :"src_square" => {
252
+ :"...attacked?" => nil,
253
+ :"...occupied!" => false,
254
+ :"area" => :all
255
+ },
256
+ :"dst_square" => {
257
+ :"...attacked?" => nil,
258
+ :"...occupied!" => :an_enemy_actor,
259
+ :"area" => :all
260
+ },
261
+ :"promotable_into_actors" => [:self]
262
+ }
263
+ }
264
+ ],
265
+
266
+
267
+
268
+ [
269
+ {
270
+ :"subject" => {
271
+ :"...ally?" => true,
272
+ :"actor" => :self,
273
+ :"state" => {
274
+ :"...last_moved_actor?" => nil,
275
+ :"...previous_moves_counter" => nil
354
276
  }
355
- ],
356
-
357
-
358
-
359
- [
360
- {
361
- :"subject" => {
362
- :"...ally?" => true,
363
- :"actor" => :self,
364
- :"state" => {
365
- :"...last_moved_actor?" => nil,
366
- :"...previous_moves_counter" => nil
367
- }
368
- },
369
-
370
- :"verb" => {
371
- :"name" => :shift,
372
- :"vector" => {:"...maximum_magnitude" => nil, direction: [0,1]}
373
- },
374
-
375
- :"object" => {
376
- :"src_square" => {
377
- :"...attacked?" => nil,
378
- :"...occupied!" => false,
379
- :"area" => :all
380
- },
381
- :"dst_square" => {
382
- :"...attacked?" => nil,
383
- :"...occupied!" => false,
384
- :"area" => :all
385
- },
386
- :"promotable_into_actors" => [:self]
387
- }
277
+ },
278
+
279
+ :"verb" => {
280
+ :"name" => :shift,
281
+ :"vector" => {:"...maximum_magnitude" => nil, direction: [0,-1]}
282
+ },
283
+
284
+ :"object" => {
285
+ :"src_square" => {
286
+ :"...attacked?" => nil,
287
+ :"...occupied!" => false,
288
+ :"area" => :all
289
+ },
290
+ :"dst_square" => {
291
+ :"...attacked?" => nil,
292
+ :"...occupied!" => false,
293
+ :"area" => :all
294
+ },
295
+ :"promotable_into_actors" => [:self]
296
+ }
297
+ }
298
+ ],
299
+
300
+
301
+
302
+ [
303
+ {
304
+ :"subject" => {
305
+ :"...ally?" => true,
306
+ :"actor" => :self,
307
+ :"state" => {
308
+ :"...last_moved_actor?" => nil,
309
+ :"...previous_moves_counter" => nil
388
310
  }
389
- ],
390
-
391
-
392
-
393
- [
394
- {
395
- :"subject" => {
396
- :"...ally?" => true,
397
- :"actor" => :self,
398
- :"state" => {
399
- :"...last_moved_actor?" => nil,
400
- :"...previous_moves_counter" => nil
401
- }
402
- },
403
-
404
- :"verb" => {
405
- :"name" => :shift,
406
- :"vector" => {:"...maximum_magnitude" => nil, direction: [0,1]}
407
- },
408
-
409
- :"object" => {
410
- :"src_square" => {
411
- :"...attacked?" => nil,
412
- :"...occupied!" => false,
413
- :"area" => :all
414
- },
415
- :"dst_square" => {
416
- :"...attacked?" => nil,
417
- :"...occupied!" => false,
418
- :"area" => :all
419
- },
420
- :"promotable_into_actors" => [:self]
421
- }
422
- },
423
- {
424
- :"subject" => {
425
- :"...ally?" => true,
426
- :"actor" => :self,
427
- :"state" => {
428
- :"...last_moved_actor?" => nil,
429
- :"...previous_moves_counter" => nil
430
- }
431
- },
432
-
433
- :"verb" => {
434
- :"name" => :remove,
435
- :"vector" => {:"...maximum_magnitude" => 1, direction: [0,1]}
436
- },
437
-
438
- :"object" => {
439
- :"src_square" => {
440
- :"...attacked?" => nil,
441
- :"...occupied!" => false,
442
- :"area" => :all
443
- },
444
- :"dst_square" => {
445
- :"...attacked?" => nil,
446
- :"...occupied!" => :an_enemy_actor,
447
- :"area" => :all
448
- },
449
- :"promotable_into_actors" => [:self]
450
- }
311
+ },
312
+
313
+ :"verb" => {
314
+ :"name" => :shift,
315
+ :"vector" => {:"...maximum_magnitude" => nil, direction: [0,-1]}
316
+ },
317
+
318
+ :"object" => {
319
+ :"src_square" => {
320
+ :"...attacked?" => nil,
321
+ :"...occupied!" => false,
322
+ :"area" => :all
323
+ },
324
+ :"dst_square" => {
325
+ :"...attacked?" => nil,
326
+ :"...occupied!" => false,
327
+ :"area" => :all
328
+ },
329
+ :"promotable_into_actors" => [:self]
330
+ }
331
+ },
332
+ {
333
+ :"subject" => {
334
+ :"...ally?" => true,
335
+ :"actor" => :self,
336
+ :"state" => {
337
+ :"...last_moved_actor?" => nil,
338
+ :"...previous_moves_counter" => nil
339
+ }
340
+ },
341
+
342
+ :"verb" => {
343
+ :"name" => :remove,
344
+ :"vector" => {:"...maximum_magnitude" => 1, direction: [0,-1]}
345
+ },
346
+
347
+ :"object" => {
348
+ :"src_square" => {
349
+ :"...attacked?" => nil,
350
+ :"...occupied!" => false,
351
+ :"area" => :all
352
+ },
353
+ :"dst_square" => {
354
+ :"...attacked?" => nil,
355
+ :"...occupied!" => :an_enemy_actor,
356
+ :"area" => :all
357
+ },
358
+ :"promotable_into_actors" => [:self]
359
+ }
360
+ }
361
+ ],
362
+
363
+
364
+
365
+ [
366
+ {
367
+ :"subject" => {
368
+ :"...ally?" => true,
369
+ :"actor" => :self,
370
+ :"state" => {
371
+ :"...last_moved_actor?" => nil,
372
+ :"...previous_moves_counter" => nil
373
+ }
374
+ },
375
+
376
+ :"verb" => {
377
+ :"name" => :shift,
378
+ :"vector" => {:"...maximum_magnitude" => nil, direction: [0,1]}
379
+ },
380
+
381
+ :"object" => {
382
+ :"src_square" => {
383
+ :"...attacked?" => nil,
384
+ :"...occupied!" => false,
385
+ :"area" => :all
386
+ },
387
+ :"dst_square" => {
388
+ :"...attacked?" => nil,
389
+ :"...occupied!" => false,
390
+ :"area" => :all
391
+ },
392
+ :"promotable_into_actors" => [:self]
393
+ }
394
+ }
395
+ ],
396
+
397
+
398
+
399
+ [
400
+ {
401
+ :"subject" => {
402
+ :"...ally?" => true,
403
+ :"actor" => :self,
404
+ :"state" => {
405
+ :"...last_moved_actor?" => nil,
406
+ :"...previous_moves_counter" => nil
451
407
  }
452
- ],
453
-
454
-
455
-
456
- [
457
- {
458
- :"subject" => {
459
- :"...ally?" => true,
460
- :"actor" => :self,
461
- :"state" => {
462
- :"...last_moved_actor?" => nil,
463
- :"...previous_moves_counter" => nil
464
- }
465
- },
466
-
467
- :"verb" => {
468
- :"name" => :shift,
469
- :"vector" => {:"...maximum_magnitude" => nil, direction: [1,0]}
470
- },
471
-
472
- :"object" => {
473
- :"src_square" => {
474
- :"...attacked?" => nil,
475
- :"...occupied!" => false,
476
- :"area" => :all
477
- },
478
- :"dst_square" => {
479
- :"...attacked?" => nil,
480
- :"...occupied!" => false,
481
- :"area" => :all
482
- },
483
- :"promotable_into_actors" => [:self]
484
- }
408
+ },
409
+
410
+ :"verb" => {
411
+ :"name" => :shift,
412
+ :"vector" => {:"...maximum_magnitude" => nil, direction: [0,1]}
413
+ },
414
+
415
+ :"object" => {
416
+ :"src_square" => {
417
+ :"...attacked?" => nil,
418
+ :"...occupied!" => false,
419
+ :"area" => :all
420
+ },
421
+ :"dst_square" => {
422
+ :"...attacked?" => nil,
423
+ :"...occupied!" => false,
424
+ :"area" => :all
425
+ },
426
+ :"promotable_into_actors" => [:self]
427
+ }
428
+ },
429
+ {
430
+ :"subject" => {
431
+ :"...ally?" => true,
432
+ :"actor" => :self,
433
+ :"state" => {
434
+ :"...last_moved_actor?" => nil,
435
+ :"...previous_moves_counter" => nil
485
436
  }
486
- ],
487
-
488
-
489
-
490
- [
491
- {
492
- :"subject" => {
493
- :"...ally?" => true,
494
- :"actor" => :self,
495
- :"state" => {
496
- :"...last_moved_actor?" => nil,
497
- :"...previous_moves_counter" => nil
498
- }
499
- },
500
-
501
- :"verb" => {
502
- :"name" => :shift,
503
- :"vector" => {:"...maximum_magnitude" => nil, direction: [1,0]}
504
- },
505
-
506
- :"object" => {
507
- :"src_square" => {
508
- :"...attacked?" => nil,
509
- :"...occupied!" => false,
510
- :"area" => :all
511
- },
512
- :"dst_square" => {
513
- :"...attacked?" => nil,
514
- :"...occupied!" => false,
515
- :"area" => :all
516
- },
517
- :"promotable_into_actors" => [:self]
518
- }
519
- },
520
- {
521
- :"subject" => {
522
- :"...ally?" => true,
523
- :"actor" => :self,
524
- :"state" => {
525
- :"...last_moved_actor?" => nil,
526
- :"...previous_moves_counter" => nil
527
- }
528
- },
529
-
530
- :"verb" => {
531
- :"name" => :remove,
532
- :"vector" => {:"...maximum_magnitude" => 1, direction: [1,0]}
533
- },
534
-
535
- :"object" => {
536
- :"src_square" => {
537
- :"...attacked?" => nil,
538
- :"...occupied!" => false,
539
- :"area" => :all
540
- },
541
- :"dst_square" => {
542
- :"...attacked?" => nil,
543
- :"...occupied!" => :an_enemy_actor,
544
- :"area" => :all
545
- },
546
- :"promotable_into_actors" => [:self]
547
- }
437
+ },
438
+
439
+ :"verb" => {
440
+ :"name" => :remove,
441
+ :"vector" => {:"...maximum_magnitude" => 1, direction: [0,1]}
442
+ },
443
+
444
+ :"object" => {
445
+ :"src_square" => {
446
+ :"...attacked?" => nil,
447
+ :"...occupied!" => false,
448
+ :"area" => :all
449
+ },
450
+ :"dst_square" => {
451
+ :"...attacked?" => nil,
452
+ :"...occupied!" => :an_enemy_actor,
453
+ :"area" => :all
454
+ },
455
+ :"promotable_into_actors" => [:self]
456
+ }
457
+ }
458
+ ],
459
+
460
+
461
+
462
+ [
463
+ {
464
+ :"subject" => {
465
+ :"...ally?" => true,
466
+ :"actor" => :self,
467
+ :"state" => {
468
+ :"...last_moved_actor?" => nil,
469
+ :"...previous_moves_counter" => nil
548
470
  }
549
- ]
550
- ]
471
+ },
472
+
473
+ :"verb" => {
474
+ :"name" => :shift,
475
+ :"vector" => {:"...maximum_magnitude" => nil, direction: [1,0]}
476
+ },
477
+
478
+ :"object" => {
479
+ :"src_square" => {
480
+ :"...attacked?" => nil,
481
+ :"...occupied!" => false,
482
+ :"area" => :all
483
+ },
484
+ :"dst_square" => {
485
+ :"...attacked?" => nil,
486
+ :"...occupied!" => false,
487
+ :"area" => :all
488
+ },
489
+ :"promotable_into_actors" => [:self]
490
+ }
491
+ }
492
+ ],
551
493
 
552
- gameplay = Sashite::GGN.new arr
553
494
 
554
- gameplay.to_s
555
- # => "t<self>_&_^remove[-1,0]1/t=_@f+all~_@an_enemy_actor+all%self. t<self>_&_^remove[0,-1]1/t=_@f+all~_@an_enemy_actor+all%self. t<self>_&_^remove[0,1]1/t=_@f+all~_@an_enemy_actor+all%self. t<self>_&_^remove[1,0]1/t=_@f+all~_@an_enemy_actor+all%self. t<self>_&_^shift[-1,0]_/t=_@f+all~_@f+all%self. t<self>_&_^shift[-1,0]_/t=_@f+all~_@f+all%self; t<self>_&_^remove[-1,0]1/t=_@f+all~_@an_enemy_actor+all%self. t<self>_&_^shift[0,-1]_/t=_@f+all~_@f+all%self. t<self>_&_^shift[0,-1]_/t=_@f+all~_@f+all%self; t<self>_&_^remove[0,-1]1/t=_@f+all~_@an_enemy_actor+all%self. t<self>_&_^shift[0,1]_/t=_@f+all~_@f+all%self. t<self>_&_^shift[0,1]_/t=_@f+all~_@f+all%self; t<self>_&_^remove[0,1]1/t=_@f+all~_@an_enemy_actor+all%self. t<self>_&_^shift[1,0]_/t=_@f+all~_@f+all%self. t<self>_&_^shift[1,0]_/t=_@f+all~_@f+all%self; t<self>_&_^remove[1,0]1/t=_@f+all~_@an_enemy_actor+all%self."
556
495
 
557
- gameplay.to_cgh
558
- # => "dcc5944dd91f82007904126bf2780a9922186b90"
496
+ [
497
+ {
498
+ :"subject" => {
499
+ :"...ally?" => true,
500
+ :"actor" => :self,
501
+ :"state" => {
502
+ :"...last_moved_actor?" => nil,
503
+ :"...previous_moves_counter" => nil
504
+ }
505
+ },
506
+
507
+ :"verb" => {
508
+ :"name" => :shift,
509
+ :"vector" => {:"...maximum_magnitude" => nil, direction: [1,0]}
510
+ },
511
+
512
+ :"object" => {
513
+ :"src_square" => {
514
+ :"...attacked?" => nil,
515
+ :"...occupied!" => false,
516
+ :"area" => :all
517
+ },
518
+ :"dst_square" => {
519
+ :"...attacked?" => nil,
520
+ :"...occupied!" => false,
521
+ :"area" => :all
522
+ },
523
+ :"promotable_into_actors" => [:self]
524
+ }
525
+ },
526
+ {
527
+ :"subject" => {
528
+ :"...ally?" => true,
529
+ :"actor" => :self,
530
+ :"state" => {
531
+ :"...last_moved_actor?" => nil,
532
+ :"...previous_moves_counter" => nil
533
+ }
534
+ },
535
+
536
+ :"verb" => {
537
+ :"name" => :remove,
538
+ :"vector" => {:"...maximum_magnitude" => 1, direction: [1,0]}
539
+ },
540
+
541
+ :"object" => {
542
+ :"src_square" => {
543
+ :"...attacked?" => nil,
544
+ :"...occupied!" => false,
545
+ :"area" => :all
546
+ },
547
+ :"dst_square" => {
548
+ :"...attacked?" => nil,
549
+ :"...occupied!" => :an_enemy_actor,
550
+ :"area" => :all
551
+ },
552
+ :"promotable_into_actors" => [:self]
553
+ }
554
+ }
555
+ ]
556
+ ]
557
+
558
+ Sashite::GGN.load(ggn_obj)
559
+ # => "t<self>_&_^remove[-1,0]1/t=_@f+all~_@an_enemy_actor+all%self. t<self>_&_^remove[0,-1]1/t=_@f+all~_@an_enemy_actor+all%self. t<self>_&_^remove[0,1]1/t=_@f+all~_@an_enemy_actor+all%self. t<self>_&_^remove[1,0]1/t=_@f+all~_@an_enemy_actor+all%self. t<self>_&_^shift[-1,0]_/t=_@f+all~_@f+all%self. t<self>_&_^shift[-1,0]_/t=_@f+all~_@f+all%self; t<self>_&_^remove[-1,0]1/t=_@f+all~_@an_enemy_actor+all%self. t<self>_&_^shift[0,-1]_/t=_@f+all~_@f+all%self. t<self>_&_^shift[0,-1]_/t=_@f+all~_@f+all%self; t<self>_&_^remove[0,-1]1/t=_@f+all~_@an_enemy_actor+all%self. t<self>_&_^shift[0,1]_/t=_@f+all~_@f+all%self. t<self>_&_^shift[0,1]_/t=_@f+all~_@f+all%self; t<self>_&_^remove[0,1]1/t=_@f+all~_@an_enemy_actor+all%self. t<self>_&_^shift[1,0]_/t=_@f+all~_@f+all%self. t<self>_&_^shift[1,0]_/t=_@f+all~_@f+all%self; t<self>_&_^remove[1,0]1/t=_@f+all~_@an_enemy_actor+all%self."
560
+ ```
559
561
 
560
562
  ## Contributing
561
563