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.
- checksums.yaml +4 -4
- data/README.md +523 -521
- data/VERSION.semver +1 -1
- data/lib/sashite/ggn.rb +3 -2
- data/lib/sashite/ggn/ability.rb +11 -19
- data/lib/sashite/ggn/actor.rb +5 -13
- data/lib/sashite/ggn/ally.rb +6 -14
- data/lib/sashite/ggn/area.rb +6 -14
- data/lib/sashite/ggn/attacked.rb +6 -14
- data/lib/sashite/ggn/boolean.rb +6 -14
- data/lib/sashite/ggn/digit.rb +6 -14
- data/lib/sashite/ggn/digit_excluding_zero.rb +6 -14
- data/lib/sashite/ggn/direction.rb +6 -14
- data/lib/sashite/ggn/gameplay.rb +8 -28
- data/lib/sashite/ggn/gameplay_into_base64.rb +7 -14
- data/lib/sashite/ggn/integer.rb +6 -14
- data/lib/sashite/ggn/last_moved_actor.rb +6 -14
- data/lib/sashite/ggn/maximum_magnitude.rb +6 -14
- data/lib/sashite/ggn/name.rb +6 -14
- data/lib/sashite/ggn/negative_integer.rb +6 -14
- data/lib/sashite/ggn/null.rb +7 -9
- data/lib/sashite/ggn/object.rb +11 -19
- data/lib/sashite/ggn/occupied.rb +12 -20
- data/lib/sashite/ggn/pattern.rb +7 -16
- data/lib/sashite/ggn/previous_moves_counter.rb +6 -14
- data/lib/sashite/ggn/promotable_into_actors.rb +8 -17
- data/lib/sashite/ggn/required.rb +6 -14
- data/lib/sashite/ggn/self.rb +7 -9
- data/lib/sashite/ggn/square.rb +11 -19
- data/lib/sashite/ggn/state.rb +9 -17
- data/lib/sashite/ggn/subject.rb +11 -19
- data/lib/sashite/ggn/unsigned_integer.rb +6 -14
- data/lib/sashite/ggn/unsigned_integer_excluding_zero.rb +5 -13
- data/lib/sashite/ggn/verb.rb +15 -24
- data/lib/sashite/ggn/zero.rb +7 -9
- data/sashite-ggn.gemspec +2 -4
- data/test/test_ggn.rb +501 -495
- data/test/test_ggn_ability.rb +10 -10
- data/test/test_ggn_actor.rb +516 -536
- data/test/test_ggn_ally.rb +13 -29
- data/test/test_ggn_area.rb +9 -67
- data/test/test_ggn_attacked.rb +13 -29
- data/test/test_ggn_boolean.rb +10 -26
- data/test/test_ggn_digit.rb +10 -10
- data/test/test_ggn_digit_excluding_zero.rb +10 -11
- data/test/test_ggn_direction.rb +10 -10
- data/test/test_ggn_gameplay.rb +22 -38
- data/test/test_ggn_gameplay_into_base64.rb +511 -501
- data/test/test_ggn_integer.rb +19 -21
- data/test/test_ggn_last_moved_actor.rb +13 -29
- data/test/test_ggn_maximum_magnitude.rb +18 -16
- data/test/test_ggn_name.rb +9 -39
- data/test/test_ggn_negative_integer.rb +10 -10
- data/test/test_ggn_null.rb +10 -10
- data/test/test_ggn_object.rb +22 -24
- data/test/test_ggn_occupied.rb +40 -64
- data/test/test_ggn_pattern.rb +12 -10
- data/test/test_ggn_previous_moves_counter.rb +18 -20
- data/test/test_ggn_promotable_into_actors.rb +529 -549
- data/test/test_ggn_required.rb +10 -26
- data/test/test_ggn_self.rb +10 -10
- data/test/test_ggn_square.rb +14 -16
- data/test/test_ggn_state.rb +15 -19
- data/test/test_ggn_subject.rb +17 -19
- data/test/test_ggn_unsigned_integer.rb +30 -12
- data/test/test_ggn_unsigned_integer_excluding_zero.rb +14 -10
- data/test/test_ggn_verb.rb +16 -15
- data/test/test_ggn_zero.rb +10 -10
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc3e41d95a692971ccd464ef45040baa3766c3e1
|
4
|
+
data.tar.gz: c8511f5a3bfb0cba38e55abc1c1bafee472413f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
:"
|
41
|
-
|
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
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
:"
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
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
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
:"
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
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
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
:"
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
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
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
:"
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
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
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
:"
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
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
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
:"
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
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
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
:"
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
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
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
:"
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
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
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
:"
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
}
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
:"
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
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
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
:"
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
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
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
:"
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
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
|
-
|
558
|
-
|
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
|
|