sashite-ggn 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/.ruby-version +1 -0
- data/.travis.yml +3 -0
- data/Gemfile +2 -0
- data/LICENSE.md +22 -0
- data/README.md +566 -0
- data/Rakefile +7 -0
- data/VERSION.semver +1 -0
- data/lib/sashite-ggn.rb +1 -0
- data/lib/sashite/ggn.rb +9 -0
- data/lib/sashite/ggn/ability.rb +37 -0
- data/lib/sashite/ggn/actor.rb +28 -0
- data/lib/sashite/ggn/ally.rb +28 -0
- data/lib/sashite/ggn/area.rb +25 -0
- data/lib/sashite/ggn/attacked.rb +28 -0
- data/lib/sashite/ggn/boolean.rb +25 -0
- data/lib/sashite/ggn/digit.rb +28 -0
- data/lib/sashite/ggn/digit_excluding_zero.rb +25 -0
- data/lib/sashite/ggn/direction.rb +27 -0
- data/lib/sashite/ggn/gameplay.rb +40 -0
- data/lib/sashite/ggn/gameplay_into_base64.rb +28 -0
- data/lib/sashite/ggn/integer.rb +28 -0
- data/lib/sashite/ggn/last_moved_actor.rb +28 -0
- data/lib/sashite/ggn/maximum_magnitude.rb +28 -0
- data/lib/sashite/ggn/name.rb +25 -0
- data/lib/sashite/ggn/negative_integer.rb +27 -0
- data/lib/sashite/ggn/null.rb +23 -0
- data/lib/sashite/ggn/object.rb +36 -0
- data/lib/sashite/ggn/occupied.rb +37 -0
- data/lib/sashite/ggn/pattern.rb +29 -0
- data/lib/sashite/ggn/previous_moves_counter.rb +28 -0
- data/lib/sashite/ggn/promotable_into_actors.rb +32 -0
- data/lib/sashite/ggn/required.rb +27 -0
- data/lib/sashite/ggn/self.rb +23 -0
- data/lib/sashite/ggn/square.rb +37 -0
- data/lib/sashite/ggn/state.rb +34 -0
- data/lib/sashite/ggn/subject.rb +37 -0
- data/lib/sashite/ggn/unsigned_integer.rb +28 -0
- data/lib/sashite/ggn/unsigned_integer_excluding_zero.rb +28 -0
- data/lib/sashite/ggn/verb.rb +42 -0
- data/lib/sashite/ggn/zero.rb +23 -0
- data/sashite-ggn.gemspec +21 -0
- data/test/_test_helper.rb +2 -0
- data/test/test_ggn.rb +546 -0
- data/test/test_ggn_ability.rb +51 -0
- data/test/test_ggn_actor.rb +591 -0
- data/test/test_ggn_ally.rb +51 -0
- data/test/test_ggn_area.rb +79 -0
- data/test/test_ggn_attacked.rb +51 -0
- data/test/test_ggn_boolean.rb +37 -0
- data/test/test_ggn_digit.rb +21 -0
- data/test/test_ggn_digit_excluding_zero.rb +22 -0
- data/test/test_ggn_direction.rb +21 -0
- data/test/test_ggn_gameplay.rb +573 -0
- data/test/test_ggn_gameplay_into_base64.rb +545 -0
- data/test/test_ggn_integer.rb +41 -0
- data/test/test_ggn_last_moved_actor.rb +51 -0
- data/test/test_ggn_maximum_magnitude.rb +37 -0
- data/test/test_ggn_name.rb +51 -0
- data/test/test_ggn_negative_integer.rb +21 -0
- data/test/test_ggn_null.rb +21 -0
- data/test/test_ggn_object.rb +35 -0
- data/test/test_ggn_occupied.rb +102 -0
- data/test/test_ggn_pattern.rb +82 -0
- data/test/test_ggn_previous_moves_counter.rb +41 -0
- data/test/test_ggn_promotable_into_actors.rb +598 -0
- data/test/test_ggn_required.rb +37 -0
- data/test/test_ggn_self.rb +21 -0
- data/test/test_ggn_square.rb +27 -0
- data/test/test_ggn_state.rb +28 -0
- data/test/test_ggn_subject.rb +30 -0
- data/test/test_ggn_unsigned_integer.rb +21 -0
- data/test/test_ggn_unsigned_integer_excluding_zero.rb +21 -0
- data/test/test_ggn_verb.rb +26 -0
- data/test/test_ggn_zero.rb +21 -0
- metadata +208 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d56341d1394c220628569276f96dae65030b09a2
|
4
|
+
data.tar.gz: 38d100bd971288c6118308398dfc7c00f4537507
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 107e54756a40b47831976053068b164beec23602cc969f4b821a32ebc3ebd620cc28a80afa312a55fb35b6029bf017cd9da6eb6e5c463756f11f6b4592f5b2fd
|
7
|
+
data.tar.gz: 70742aab97dc8d75041273401f4f5a8f87f29c4328d0c401747c9fd367365cd765da7e48bcb42d11ce1e690d13f8fa51061e02927022cfb1e005e1719fb1ac66
|
data/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.1.2
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Cyril Wack
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,566 @@
|
|
1
|
+
# Sashite::GGN
|
2
|
+
|
3
|
+
This module provides a Ruby interface for gameplay serialization in [GGN](http://sashite.wiki/General_Gameplay_Notation) format.
|
4
|
+
|
5
|
+
## Status
|
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)
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
Add this line to your application's Gemfile:
|
13
|
+
|
14
|
+
gem 'sashite-ggn'
|
15
|
+
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
$ bundle
|
19
|
+
|
20
|
+
Or install it yourself as:
|
21
|
+
|
22
|
+
$ gem install sashite-ggn
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
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
|
+
}
|
58
|
+
}
|
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
|
+
}
|
92
|
+
}
|
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
|
+
}
|
126
|
+
}
|
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
|
+
}
|
160
|
+
}
|
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
|
+
}
|
194
|
+
}
|
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
|
+
}
|
257
|
+
}
|
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
|
+
}
|
291
|
+
}
|
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
|
+
}
|
354
|
+
}
|
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
|
+
}
|
388
|
+
}
|
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
|
+
}
|
451
|
+
}
|
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
|
+
}
|
485
|
+
}
|
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
|
+
}
|
548
|
+
}
|
549
|
+
]
|
550
|
+
]
|
551
|
+
|
552
|
+
gameplay = Sashite::GGN.new arr
|
553
|
+
|
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
|
+
|
557
|
+
gameplay.to_cgh
|
558
|
+
# => "dcc5944dd91f82007904126bf2780a9922186b90"
|
559
|
+
|
560
|
+
## Contributing
|
561
|
+
|
562
|
+
1. Fork it
|
563
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
564
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
565
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
566
|
+
5. Create a new Pull Request
|