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
data/test/test_ggn_ally.rb
CHANGED
@@ -1,51 +1,35 @@
|
|
1
1
|
require_relative '_test_helper'
|
2
2
|
|
3
3
|
describe Sashite::GGN::Ally do
|
4
|
-
|
5
|
-
describe 'false' do
|
6
|
-
before do
|
7
|
-
@ally = Sashite::GGN::Ally.new('f')
|
8
|
-
end
|
4
|
+
subject { Sashite::GGN::Ally }
|
9
5
|
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'returns the GGN as a string' do
|
15
|
-
@ally.to_s.must_equal 'f'
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
describe 'true' do
|
6
|
+
describe '.load' do
|
7
|
+
describe 'boolean' do
|
20
8
|
before do
|
21
|
-
@
|
9
|
+
@ggn_obj = 't'
|
22
10
|
end
|
23
11
|
|
24
|
-
it '
|
25
|
-
@
|
12
|
+
it 'loads a document from the current io stream' do
|
13
|
+
subject.load(@ggn_obj).must_equal true
|
26
14
|
end
|
27
15
|
|
28
|
-
it '
|
29
|
-
|
16
|
+
it 'raises an error' do
|
17
|
+
-> { subject.load 'true' }.must_raise ArgumentError
|
30
18
|
end
|
31
19
|
end
|
32
20
|
|
33
21
|
describe 'null' do
|
34
22
|
before do
|
35
|
-
@
|
23
|
+
@ggn_obj = '_'
|
36
24
|
end
|
37
25
|
|
38
|
-
it '
|
39
|
-
@
|
26
|
+
it 'loads a document from the current io stream' do
|
27
|
+
subject.load(@ggn_obj).must_equal nil
|
40
28
|
end
|
41
29
|
|
42
|
-
it '
|
43
|
-
|
30
|
+
it 'raises an error' do
|
31
|
+
-> { subject.load '' }.must_raise ArgumentError
|
44
32
|
end
|
45
33
|
end
|
46
34
|
end
|
47
|
-
|
48
|
-
it 'raises an error' do
|
49
|
-
-> { Sashite::GGN::Ally.new('foobar') }.must_raise ArgumentError
|
50
|
-
end
|
51
35
|
end
|
data/test/test_ggn_area.rb
CHANGED
@@ -1,79 +1,21 @@
|
|
1
1
|
require_relative '_test_helper'
|
2
2
|
|
3
3
|
describe Sashite::GGN::Area do
|
4
|
-
|
5
|
-
describe 'all' do
|
6
|
-
before do
|
7
|
-
@area = Sashite::GGN::Area.new('all')
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'returns the GGN as a JSON' do
|
11
|
-
@area.as_json.must_equal :all
|
12
|
-
end
|
4
|
+
subject { Sashite::GGN::Area }
|
13
5
|
|
14
|
-
|
15
|
-
|
16
|
-
|
6
|
+
describe '.load' do
|
7
|
+
before do
|
8
|
+
@ggn_obj = 'furthest_rank'
|
17
9
|
end
|
18
10
|
|
19
|
-
|
20
|
-
|
21
|
-
@area = Sashite::GGN::Area.new('furthest_rank')
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'returns the GGN as a JSON' do
|
25
|
-
@area.as_json.must_equal :furthest_rank
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'returns the GGN as a string' do
|
29
|
-
@area.to_s.must_equal 'furthest_rank'
|
30
|
-
end
|
11
|
+
it 'loads a document from the current io stream' do
|
12
|
+
subject.load(@ggn_obj).must_equal :furthest_rank
|
31
13
|
end
|
32
14
|
|
33
|
-
describe '
|
34
|
-
|
35
|
-
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'returns the GGN as a JSON' do
|
39
|
-
@area.as_json.must_equal :palace
|
40
|
-
end
|
41
|
-
|
42
|
-
it 'returns the GGN as a string' do
|
43
|
-
@area.to_s.must_equal 'palace'
|
15
|
+
describe 'errors' do
|
16
|
+
it 'raises without an area' do
|
17
|
+
-> { subject.load 'foobar' }.must_raise ArgumentError
|
44
18
|
end
|
45
19
|
end
|
46
|
-
|
47
|
-
describe 'furthest one-third' do
|
48
|
-
before do
|
49
|
-
@area = Sashite::GGN::Area.new('furthest_one-third')
|
50
|
-
end
|
51
|
-
|
52
|
-
it 'returns the GGN as a JSON' do
|
53
|
-
@area.as_json.must_equal :'furthest_one-third'
|
54
|
-
end
|
55
|
-
|
56
|
-
it 'returns the GGN as a string' do
|
57
|
-
@area.to_s.must_equal 'furthest_one-third'
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
describe 'nearest two-thirds' do
|
62
|
-
before do
|
63
|
-
@area = Sashite::GGN::Area.new('nearest_two-thirds')
|
64
|
-
end
|
65
|
-
|
66
|
-
it 'returns the GGN as a JSON' do
|
67
|
-
@area.as_json.must_equal :'nearest_two-thirds'
|
68
|
-
end
|
69
|
-
|
70
|
-
it 'returns the GGN as a string' do
|
71
|
-
@area.to_s.must_equal 'nearest_two-thirds'
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
it 'raises an error' do
|
77
|
-
-> { Sashite::GGN::Area.new('foobar') }.must_raise ArgumentError
|
78
20
|
end
|
79
21
|
end
|
data/test/test_ggn_attacked.rb
CHANGED
@@ -1,51 +1,35 @@
|
|
1
1
|
require_relative '_test_helper'
|
2
2
|
|
3
3
|
describe Sashite::GGN::Attacked do
|
4
|
-
|
5
|
-
describe 'false' do
|
6
|
-
before do
|
7
|
-
@attacked = Sashite::GGN::Attacked.new('f')
|
8
|
-
end
|
4
|
+
subject { Sashite::GGN::Attacked }
|
9
5
|
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'returns the GGN as a string' do
|
15
|
-
@attacked.to_s.must_equal 'f'
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
describe 'true' do
|
6
|
+
describe '.load' do
|
7
|
+
describe 'boolean' do
|
20
8
|
before do
|
21
|
-
@
|
9
|
+
@ggn_obj = 't'
|
22
10
|
end
|
23
11
|
|
24
|
-
it '
|
25
|
-
@
|
12
|
+
it 'loads a document from the current io stream' do
|
13
|
+
subject.load(@ggn_obj).must_equal true
|
26
14
|
end
|
27
15
|
|
28
|
-
it '
|
29
|
-
|
16
|
+
it 'raises an error' do
|
17
|
+
-> { subject.load 'true' }.must_raise ArgumentError
|
30
18
|
end
|
31
19
|
end
|
32
20
|
|
33
21
|
describe 'null' do
|
34
22
|
before do
|
35
|
-
@
|
23
|
+
@ggn_obj = '_'
|
36
24
|
end
|
37
25
|
|
38
|
-
it '
|
39
|
-
@
|
26
|
+
it 'loads a document from the current io stream' do
|
27
|
+
subject.load(@ggn_obj).must_equal nil
|
40
28
|
end
|
41
29
|
|
42
|
-
it '
|
43
|
-
|
30
|
+
it 'raises an error' do
|
31
|
+
-> { subject.load '' }.must_raise ArgumentError
|
44
32
|
end
|
45
33
|
end
|
46
34
|
end
|
47
|
-
|
48
|
-
it 'raises an error' do
|
49
|
-
-> { Sashite::GGN::Attacked.new('foobar') }.must_raise ArgumentError
|
50
|
-
end
|
51
35
|
end
|
data/test/test_ggn_boolean.rb
CHANGED
@@ -1,37 +1,21 @@
|
|
1
1
|
require_relative '_test_helper'
|
2
2
|
|
3
3
|
describe Sashite::GGN::Boolean do
|
4
|
-
|
5
|
-
describe 'false' do
|
6
|
-
before do
|
7
|
-
@boolean = Sashite::GGN::Boolean.new('f')
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'returns the GGN as a JSON' do
|
11
|
-
@boolean.as_json.must_equal false
|
12
|
-
end
|
4
|
+
subject { Sashite::GGN::Boolean }
|
13
5
|
|
14
|
-
|
15
|
-
|
16
|
-
|
6
|
+
describe '.load' do
|
7
|
+
before do
|
8
|
+
@ggn_obj = 't'
|
17
9
|
end
|
18
10
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'returns the GGN as a JSON' do
|
25
|
-
@boolean.as_json.must_equal true
|
26
|
-
end
|
11
|
+
it 'loads a document from the current io stream' do
|
12
|
+
subject.load(@ggn_obj).must_equal true
|
13
|
+
end
|
27
14
|
|
28
|
-
|
29
|
-
|
15
|
+
describe 'errors' do
|
16
|
+
it 'raises without a boolean' do
|
17
|
+
-> { subject.load 'foobar' }.must_raise ArgumentError
|
30
18
|
end
|
31
19
|
end
|
32
20
|
end
|
33
|
-
|
34
|
-
it 'raises an error' do
|
35
|
-
-> { Sashite::GGN::Boolean.new('foobar') }.must_raise ArgumentError
|
36
|
-
end
|
37
21
|
end
|
data/test/test_ggn_digit.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
require_relative '_test_helper'
|
2
2
|
|
3
3
|
describe Sashite::GGN::Digit do
|
4
|
-
|
5
|
-
before do
|
6
|
-
@integer = Sashite::GGN::Digit.new('8')
|
7
|
-
end
|
4
|
+
subject { Sashite::GGN::Digit }
|
8
5
|
|
9
|
-
|
10
|
-
|
6
|
+
describe '.load' do
|
7
|
+
before do
|
8
|
+
@ggn_obj = '8'
|
11
9
|
end
|
12
10
|
|
13
|
-
it '
|
14
|
-
@
|
11
|
+
it 'loads a document from the current io stream' do
|
12
|
+
subject.load(@ggn_obj).must_equal 8
|
15
13
|
end
|
16
14
|
|
17
|
-
|
18
|
-
|
15
|
+
describe 'errors' do
|
16
|
+
it 'raises with a negative integer' do
|
17
|
+
-> { subject.load '-4' }.must_raise ArgumentError
|
18
|
+
end
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -1,22 +1,21 @@
|
|
1
1
|
require_relative '_test_helper'
|
2
2
|
|
3
3
|
describe Sashite::GGN::DigitExcludingZero do
|
4
|
-
|
4
|
+
subject { Sashite::GGN::DigitExcludingZero }
|
5
|
+
|
6
|
+
describe '.load' do
|
5
7
|
before do
|
6
|
-
@
|
8
|
+
@ggn_obj = '8'
|
7
9
|
end
|
8
10
|
|
9
|
-
it '
|
10
|
-
@
|
11
|
+
it 'loads a document from the current io stream' do
|
12
|
+
subject.load(@ggn_obj).must_equal 8
|
11
13
|
end
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
+
describe 'errors' do
|
16
|
+
it 'raises with zero' do
|
17
|
+
-> { subject.load '0' }.must_raise ArgumentError
|
18
|
+
end
|
15
19
|
end
|
16
20
|
end
|
17
|
-
|
18
|
-
it 'raises an error' do
|
19
|
-
-> { Sashite::GGN::DigitExcludingZero.new( '0') }.must_raise ArgumentError
|
20
|
-
-> { Sashite::GGN::DigitExcludingZero.new('42') }.must_raise ArgumentError
|
21
|
-
end
|
22
21
|
end
|
data/test/test_ggn_direction.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
require_relative '_test_helper'
|
2
2
|
|
3
3
|
describe Sashite::GGN::Direction do
|
4
|
-
|
4
|
+
subject { Sashite::GGN::Direction }
|
5
|
+
|
6
|
+
describe '.load' do
|
5
7
|
before do
|
6
|
-
@
|
8
|
+
@ggn_obj = '0,1,2,3,4'
|
7
9
|
end
|
8
10
|
|
9
|
-
it '
|
10
|
-
@
|
11
|
+
it 'loads a document from the current io stream' do
|
12
|
+
subject.load(@ggn_obj).must_equal [ 0, 1, 2, 3, 4 ]
|
11
13
|
end
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
+
describe 'errors' do
|
16
|
+
it 'raises without integers' do
|
17
|
+
-> { subject.load '4,bar' }.must_raise ArgumentError
|
18
|
+
end
|
15
19
|
end
|
16
20
|
end
|
17
|
-
|
18
|
-
it 'raises an error' do
|
19
|
-
-> { Sashite::GGN::Direction.new('-01') }.must_raise ArgumentError
|
20
|
-
end
|
21
21
|
end
|
data/test/test_ggn_gameplay.rb
CHANGED
@@ -1,25 +1,26 @@
|
|
1
1
|
require_relative '_test_helper'
|
2
2
|
|
3
3
|
describe Sashite::GGN::Gameplay do
|
4
|
-
|
4
|
+
subject { Sashite::GGN::Gameplay }
|
5
|
+
|
6
|
+
describe '.load' do
|
5
7
|
before do
|
6
|
-
@
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
'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.')
|
8
|
+
@ggn_obj = 't<self>_&_^remove[-1,0]1/t=_@f+all~_@an_enemy_actor+all%self. ' +
|
9
|
+
't<self>_&_^remove[0,-1]1/t=_@f+all~_@an_enemy_actor+all%self. ' +
|
10
|
+
't<self>_&_^remove[0,1]1/t=_@f+all~_@an_enemy_actor+all%self. ' +
|
11
|
+
't<self>_&_^remove[1,0]1/t=_@f+all~_@an_enemy_actor+all%self. ' +
|
12
|
+
't<self>_&_^shift[-1,0]_/t=_@f+all~_@f+all%self. ' +
|
13
|
+
'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. ' +
|
14
|
+
't<self>_&_^shift[0,-1]_/t=_@f+all~_@f+all%self. ' +
|
15
|
+
'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. ' +
|
16
|
+
't<self>_&_^shift[0,1]_/t=_@f+all~_@f+all%self. ' +
|
17
|
+
'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. ' +
|
18
|
+
't<self>_&_^shift[1,0]_/t=_@f+all~_@f+all%self. ' +
|
19
|
+
'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.'
|
19
20
|
end
|
20
21
|
|
21
|
-
it '
|
22
|
-
@
|
22
|
+
it 'loads a document from the current io stream' do
|
23
|
+
subject.load(@ggn_obj).hash.must_equal(
|
23
24
|
[
|
24
25
|
[
|
25
26
|
{
|
@@ -546,28 +547,11 @@ describe Sashite::GGN::Gameplay do
|
|
546
547
|
)
|
547
548
|
end
|
548
549
|
|
549
|
-
|
550
|
-
|
551
|
-
't<self>_&_^remove[-1,0]1/t=_@f+all~_@an_enemy_actor+all%self. ' +
|
552
|
-
|
553
|
-
|
554
|
-
't<self>_&_^remove[1,0]1/t=_@f+all~_@an_enemy_actor+all%self. ' +
|
555
|
-
't<self>_&_^shift[-1,0]_/t=_@f+all~_@f+all%self. ' +
|
556
|
-
'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. ' +
|
557
|
-
't<self>_&_^shift[0,-1]_/t=_@f+all~_@f+all%self. ' +
|
558
|
-
'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. ' +
|
559
|
-
't<self>_&_^shift[0,1]_/t=_@f+all~_@f+all%self. ' +
|
560
|
-
'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. ' +
|
561
|
-
't<self>_&_^shift[1,0]_/t=_@f+all~_@f+all%self. ' +
|
562
|
-
'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.')
|
563
|
-
end
|
564
|
-
|
565
|
-
it 'returns the number of dimensions' do
|
566
|
-
@gameplay.dimensions.must_equal 2
|
567
|
-
end
|
568
|
-
|
569
|
-
it 'returns the Canonical Gameplay Hash' do
|
570
|
-
@gameplay.to_cgh.must_equal 'dcc5944dd91f82007904126bf2780a9922186b90'
|
550
|
+
describe 'errors' do
|
551
|
+
it 'raises with several identical gameplays' do
|
552
|
+
-> { subject.load 't<self>_&_^remove[-1,0]1/t=_@f+all~_@an_enemy_actor+all%self. ' +
|
553
|
+
't<self>_&_^remove[-1,0]1/t=_@f+all~_@an_enemy_actor+all%self.' }.must_raise ArgumentError
|
554
|
+
end
|
571
555
|
end
|
572
556
|
end
|
573
557
|
end
|
@@ -1,545 +1,555 @@
|
|
1
1
|
require_relative '_test_helper'
|
2
2
|
|
3
3
|
describe Sashite::GGN::GameplayIntoBase64 do
|
4
|
-
|
4
|
+
subject { Sashite::GGN::GameplayIntoBase64 }
|
5
|
+
|
6
|
+
describe '.load' do
|
5
7
|
before do
|
6
|
-
@
|
8
|
+
@ggn_obj = 'dDxzZWxmPl8mX15yZW1vdmVbLTEsMF0xL3Q9X0BmK2FsbH5fQGFuX2VuZW15X2FjdG9yK2FsbCVzZWxm' +
|
9
|
+
'LiB0PHNlbGY+XyZfXnJlbW92ZVswLC0xXTEvdD1fQGYrYWxsfl9AYW5fZW5lbXlfYWN0b3IrYWxsJXNl' +
|
10
|
+
'bGYuIHQ8c2VsZj5fJl9ecmVtb3ZlWzAsMV0xL3Q9X0BmK2FsbH5fQGFuX2VuZW15X2FjdG9yK2FsbCVz' +
|
11
|
+
'ZWxmLiB0PHNlbGY+XyZfXnJlbW92ZVsxLDBdMS90PV9AZithbGx+X0Bhbl9lbmVteV9hY3RvcithbGwl' +
|
12
|
+
'c2VsZi4gdDxzZWxmPl8mX15zaGlmdFstMSwwXV8vdD1fQGYrYWxsfl9AZithbGwlc2VsZi4gdDxzZWxm' +
|
13
|
+
'Pl8mX15zaGlmdFstMSwwXV8vdD1fQGYrYWxsfl9AZithbGwlc2VsZjsgdDxzZWxmPl8mX15yZW1vdmVb' +
|
14
|
+
'LTEsMF0xL3Q9X0BmK2FsbH5fQGFuX2VuZW15X2FjdG9yK2FsbCVzZWxmLiB0PHNlbGY+XyZfXnNoaWZ0' +
|
15
|
+
'WzAsLTFdXy90PV9AZithbGx+X0BmK2FsbCVzZWxmLiB0PHNlbGY+XyZfXnNoaWZ0WzAsLTFdXy90PV9A' +
|
16
|
+
'ZithbGx+X0BmK2FsbCVzZWxmOyB0PHNlbGY+XyZfXnJlbW92ZVswLC0xXTEvdD1fQGYrYWxsfl9AYW5f' +
|
17
|
+
'ZW5lbXlfYWN0b3IrYWxsJXNlbGYuIHQ8c2VsZj5fJl9ec2hpZnRbMCwxXV8vdD1fQGYrYWxsfl9AZith' +
|
18
|
+
'bGwlc2VsZi4gdDxzZWxmPl8mX15zaGlmdFswLDFdXy90PV9AZithbGx+X0BmK2FsbCVzZWxmOyB0PHNl' +
|
19
|
+
'bGY+XyZfXnJlbW92ZVswLDFdMS90PV9AZithbGx+X0Bhbl9lbmVteV9hY3RvcithbGwlc2VsZi4gdDxz' +
|
20
|
+
'ZWxmPl8mX15zaGlmdFsxLDBdXy90PV9AZithbGx+X0BmK2FsbCVzZWxmLiB0PHNlbGY+XyZfXnNoaWZ0' +
|
21
|
+
'WzEsMF1fL3Q9X0BmK2FsbH5fQGYrYWxsJXNlbGY7IHQ8c2VsZj5fJl9ecmVtb3ZlWzEsMF0xL3Q9X0Bm' +
|
22
|
+
'K2FsbH5fQGFuX2VuZW15X2FjdG9yK2FsbCVzZWxmLg=='
|
7
23
|
end
|
8
24
|
|
9
|
-
it '
|
10
|
-
@
|
25
|
+
it 'loads a document from the current io stream' do
|
26
|
+
subject.load(@ggn_obj).hash.must_equal [
|
11
27
|
[
|
12
|
-
|
13
|
-
{
|
14
|
-
:"
|
15
|
-
|
16
|
-
|
17
|
-
:"
|
18
|
-
|
19
|
-
:"...previous_moves_counter" => nil
|
20
|
-
}
|
21
|
-
},
|
22
|
-
|
23
|
-
:"verb" => {
|
24
|
-
:"name" => :remove,
|
25
|
-
:"vector" => {:"...maximum_magnitude" => 1, direction: [-1,0]}
|
26
|
-
},
|
27
|
-
|
28
|
-
:"object" => {
|
29
|
-
:"src_square" => {
|
30
|
-
:"...attacked?" => nil,
|
31
|
-
:"...occupied!" => false,
|
32
|
-
:"area" => :all
|
33
|
-
},
|
34
|
-
:"dst_square" => {
|
35
|
-
:"...attacked?" => nil,
|
36
|
-
:"...occupied!" => :an_enemy_actor,
|
37
|
-
:"area" => :all
|
38
|
-
},
|
39
|
-
:"promotable_into_actors" => [:self]
|
28
|
+
{
|
29
|
+
:"subject" => {
|
30
|
+
:"...ally?" => true,
|
31
|
+
:"actor" => :self,
|
32
|
+
:"state" => {
|
33
|
+
:"...last_moved_actor?" => nil,
|
34
|
+
:"...previous_moves_counter" => nil
|
40
35
|
}
|
36
|
+
},
|
37
|
+
|
38
|
+
:"verb" => {
|
39
|
+
:"name" => :remove,
|
40
|
+
:"vector" => {:"...maximum_magnitude" => 1, direction: [-1,0]}
|
41
|
+
},
|
42
|
+
|
43
|
+
:"object" => {
|
44
|
+
:"src_square" => {
|
45
|
+
:"...attacked?" => nil,
|
46
|
+
:"...occupied!" => false,
|
47
|
+
:"area" => :all
|
48
|
+
},
|
49
|
+
:"dst_square" => {
|
50
|
+
:"...attacked?" => nil,
|
51
|
+
:"...occupied!" => :an_enemy_actor,
|
52
|
+
:"area" => :all
|
53
|
+
},
|
54
|
+
:"promotable_into_actors" => [:self]
|
41
55
|
}
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
},
|
56
|
-
|
57
|
-
:"verb" => {
|
58
|
-
:"name" => :remove,
|
59
|
-
:"vector" => {:"...maximum_magnitude" => 1, direction: [0,-1]}
|
60
|
-
},
|
61
|
-
|
62
|
-
:"object" => {
|
63
|
-
:"src_square" => {
|
64
|
-
:"...attacked?" => nil,
|
65
|
-
:"...occupied!" => false,
|
66
|
-
:"area" => :all
|
67
|
-
},
|
68
|
-
:"dst_square" => {
|
69
|
-
:"...attacked?" => nil,
|
70
|
-
:"...occupied!" => :an_enemy_actor,
|
71
|
-
:"area" => :all
|
72
|
-
},
|
73
|
-
:"promotable_into_actors" => [:self]
|
56
|
+
}
|
57
|
+
],
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
[
|
62
|
+
{
|
63
|
+
:"subject" => {
|
64
|
+
:"...ally?" => true,
|
65
|
+
:"actor" => :self,
|
66
|
+
:"state" => {
|
67
|
+
:"...last_moved_actor?" => nil,
|
68
|
+
:"...previous_moves_counter" => nil
|
74
69
|
}
|
70
|
+
},
|
71
|
+
|
72
|
+
:"verb" => {
|
73
|
+
:"name" => :remove,
|
74
|
+
:"vector" => {:"...maximum_magnitude" => 1, direction: [0,-1]}
|
75
|
+
},
|
76
|
+
|
77
|
+
:"object" => {
|
78
|
+
:"src_square" => {
|
79
|
+
:"...attacked?" => nil,
|
80
|
+
:"...occupied!" => false,
|
81
|
+
:"area" => :all
|
82
|
+
},
|
83
|
+
:"dst_square" => {
|
84
|
+
:"...attacked?" => nil,
|
85
|
+
:"...occupied!" => :an_enemy_actor,
|
86
|
+
:"area" => :all
|
87
|
+
},
|
88
|
+
:"promotable_into_actors" => [:self]
|
75
89
|
}
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
},
|
90
|
-
|
91
|
-
:"verb" => {
|
92
|
-
:"name" => :remove,
|
93
|
-
:"vector" => {:"...maximum_magnitude" => 1, direction: [0,1]}
|
94
|
-
},
|
95
|
-
|
96
|
-
:"object" => {
|
97
|
-
:"src_square" => {
|
98
|
-
:"...attacked?" => nil,
|
99
|
-
:"...occupied!" => false,
|
100
|
-
:"area" => :all
|
101
|
-
},
|
102
|
-
:"dst_square" => {
|
103
|
-
:"...attacked?" => nil,
|
104
|
-
:"...occupied!" => :an_enemy_actor,
|
105
|
-
:"area" => :all
|
106
|
-
},
|
107
|
-
:"promotable_into_actors" => [:self]
|
90
|
+
}
|
91
|
+
],
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
[
|
96
|
+
{
|
97
|
+
:"subject" => {
|
98
|
+
:"...ally?" => true,
|
99
|
+
:"actor" => :self,
|
100
|
+
:"state" => {
|
101
|
+
:"...last_moved_actor?" => nil,
|
102
|
+
:"...previous_moves_counter" => nil
|
108
103
|
}
|
104
|
+
},
|
105
|
+
|
106
|
+
:"verb" => {
|
107
|
+
:"name" => :remove,
|
108
|
+
:"vector" => {:"...maximum_magnitude" => 1, direction: [0,1]}
|
109
|
+
},
|
110
|
+
|
111
|
+
:"object" => {
|
112
|
+
:"src_square" => {
|
113
|
+
:"...attacked?" => nil,
|
114
|
+
:"...occupied!" => false,
|
115
|
+
:"area" => :all
|
116
|
+
},
|
117
|
+
:"dst_square" => {
|
118
|
+
:"...attacked?" => nil,
|
119
|
+
:"...occupied!" => :an_enemy_actor,
|
120
|
+
:"area" => :all
|
121
|
+
},
|
122
|
+
:"promotable_into_actors" => [:self]
|
109
123
|
}
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
},
|
124
|
-
|
125
|
-
:"verb" => {
|
126
|
-
:"name" => :remove,
|
127
|
-
:"vector" => {:"...maximum_magnitude" => 1, direction: [1,0]}
|
128
|
-
},
|
129
|
-
|
130
|
-
:"object" => {
|
131
|
-
:"src_square" => {
|
132
|
-
:"...attacked?" => nil,
|
133
|
-
:"...occupied!" => false,
|
134
|
-
:"area" => :all
|
135
|
-
},
|
136
|
-
:"dst_square" => {
|
137
|
-
:"...attacked?" => nil,
|
138
|
-
:"...occupied!" => :an_enemy_actor,
|
139
|
-
:"area" => :all
|
140
|
-
},
|
141
|
-
:"promotable_into_actors" => [:self]
|
124
|
+
}
|
125
|
+
],
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
[
|
130
|
+
{
|
131
|
+
:"subject" => {
|
132
|
+
:"...ally?" => true,
|
133
|
+
:"actor" => :self,
|
134
|
+
:"state" => {
|
135
|
+
:"...last_moved_actor?" => nil,
|
136
|
+
:"...previous_moves_counter" => nil
|
142
137
|
}
|
138
|
+
},
|
139
|
+
|
140
|
+
:"verb" => {
|
141
|
+
:"name" => :remove,
|
142
|
+
:"vector" => {:"...maximum_magnitude" => 1, direction: [1,0]}
|
143
|
+
},
|
144
|
+
|
145
|
+
:"object" => {
|
146
|
+
:"src_square" => {
|
147
|
+
:"...attacked?" => nil,
|
148
|
+
:"...occupied!" => false,
|
149
|
+
:"area" => :all
|
150
|
+
},
|
151
|
+
:"dst_square" => {
|
152
|
+
:"...attacked?" => nil,
|
153
|
+
:"...occupied!" => :an_enemy_actor,
|
154
|
+
:"area" => :all
|
155
|
+
},
|
156
|
+
:"promotable_into_actors" => [:self]
|
143
157
|
}
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
},
|
158
|
-
|
159
|
-
:"verb" => {
|
160
|
-
:"name" => :shift,
|
161
|
-
:"vector" => {:"...maximum_magnitude" => nil, direction: [-1,0]}
|
162
|
-
},
|
163
|
-
|
164
|
-
:"object" => {
|
165
|
-
:"src_square" => {
|
166
|
-
:"...attacked?" => nil,
|
167
|
-
:"...occupied!" => false,
|
168
|
-
:"area" => :all
|
169
|
-
},
|
170
|
-
:"dst_square" => {
|
171
|
-
:"...attacked?" => nil,
|
172
|
-
:"...occupied!" => false,
|
173
|
-
:"area" => :all
|
174
|
-
},
|
175
|
-
:"promotable_into_actors" => [:self]
|
158
|
+
}
|
159
|
+
],
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
[
|
164
|
+
{
|
165
|
+
:"subject" => {
|
166
|
+
:"...ally?" => true,
|
167
|
+
:"actor" => :self,
|
168
|
+
:"state" => {
|
169
|
+
:"...last_moved_actor?" => nil,
|
170
|
+
:"...previous_moves_counter" => nil
|
176
171
|
}
|
172
|
+
},
|
173
|
+
|
174
|
+
:"verb" => {
|
175
|
+
:"name" => :shift,
|
176
|
+
:"vector" => {:"...maximum_magnitude" => nil, direction: [-1,0]}
|
177
|
+
},
|
178
|
+
|
179
|
+
:"object" => {
|
180
|
+
:"src_square" => {
|
181
|
+
:"...attacked?" => nil,
|
182
|
+
:"...occupied!" => false,
|
183
|
+
:"area" => :all
|
184
|
+
},
|
185
|
+
:"dst_square" => {
|
186
|
+
:"...attacked?" => nil,
|
187
|
+
:"...occupied!" => false,
|
188
|
+
:"area" => :all
|
189
|
+
},
|
190
|
+
:"promotable_into_actors" => [:self]
|
177
191
|
}
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
},
|
192
|
-
|
193
|
-
:"verb" => {
|
194
|
-
:"name" => :shift,
|
195
|
-
:"vector" => {:"...maximum_magnitude" => nil, direction: [-1,0]}
|
196
|
-
},
|
197
|
-
|
198
|
-
:"object" => {
|
199
|
-
:"src_square" => {
|
200
|
-
:"...attacked?" => nil,
|
201
|
-
:"...occupied!" => false,
|
202
|
-
:"area" => :all
|
203
|
-
},
|
204
|
-
:"dst_square" => {
|
205
|
-
:"...attacked?" => nil,
|
206
|
-
:"...occupied!" => false,
|
207
|
-
:"area" => :all
|
208
|
-
},
|
209
|
-
:"promotable_into_actors" => [:self]
|
192
|
+
}
|
193
|
+
],
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
[
|
198
|
+
{
|
199
|
+
:"subject" => {
|
200
|
+
:"...ally?" => true,
|
201
|
+
:"actor" => :self,
|
202
|
+
:"state" => {
|
203
|
+
:"...last_moved_actor?" => nil,
|
204
|
+
:"...previous_moves_counter" => nil
|
210
205
|
}
|
211
206
|
},
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
:"
|
207
|
+
|
208
|
+
:"verb" => {
|
209
|
+
:"name" => :shift,
|
210
|
+
:"vector" => {:"...maximum_magnitude" => nil, direction: [-1,0]}
|
211
|
+
},
|
212
|
+
|
213
|
+
:"object" => {
|
214
|
+
:"src_square" => {
|
215
|
+
:"...attacked?" => nil,
|
216
|
+
:"...occupied!" => false,
|
217
|
+
:"area" => :all
|
218
|
+
},
|
219
|
+
:"dst_square" => {
|
220
|
+
:"...attacked?" => nil,
|
221
|
+
:"...occupied!" => false,
|
222
|
+
:"area" => :all
|
223
|
+
},
|
224
|
+
:"promotable_into_actors" => [:self]
|
225
|
+
}
|
226
|
+
},
|
227
|
+
{
|
228
|
+
:"subject" => {
|
229
|
+
:"...ally?" => true,
|
230
|
+
:"actor" => :self,
|
231
|
+
:"state" => {
|
232
|
+
:"...last_moved_actor?" => nil,
|
233
|
+
:"...previous_moves_counter" => nil
|
239
234
|
}
|
235
|
+
},
|
236
|
+
|
237
|
+
:"verb" => {
|
238
|
+
:"name" => :remove,
|
239
|
+
:"vector" => {:"...maximum_magnitude" => 1, direction: [-1,0]}
|
240
|
+
},
|
241
|
+
|
242
|
+
:"object" => {
|
243
|
+
:"src_square" => {
|
244
|
+
:"...attacked?" => nil,
|
245
|
+
:"...occupied!" => false,
|
246
|
+
:"area" => :all
|
247
|
+
},
|
248
|
+
:"dst_square" => {
|
249
|
+
:"...attacked?" => nil,
|
250
|
+
:"...occupied!" => :an_enemy_actor,
|
251
|
+
:"area" => :all
|
252
|
+
},
|
253
|
+
:"promotable_into_actors" => [:self]
|
240
254
|
}
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
},
|
255
|
-
|
256
|
-
:"verb" => {
|
257
|
-
:"name" => :shift,
|
258
|
-
:"vector" => {:"...maximum_magnitude" => nil, direction: [0,-1]}
|
259
|
-
},
|
260
|
-
|
261
|
-
:"object" => {
|
262
|
-
:"src_square" => {
|
263
|
-
:"...attacked?" => nil,
|
264
|
-
:"...occupied!" => false,
|
265
|
-
:"area" => :all
|
266
|
-
},
|
267
|
-
:"dst_square" => {
|
268
|
-
:"...attacked?" => nil,
|
269
|
-
:"...occupied!" => false,
|
270
|
-
:"area" => :all
|
271
|
-
},
|
272
|
-
:"promotable_into_actors" => [:self]
|
255
|
+
}
|
256
|
+
],
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
[
|
261
|
+
{
|
262
|
+
:"subject" => {
|
263
|
+
:"...ally?" => true,
|
264
|
+
:"actor" => :self,
|
265
|
+
:"state" => {
|
266
|
+
:"...last_moved_actor?" => nil,
|
267
|
+
:"...previous_moves_counter" => nil
|
273
268
|
}
|
269
|
+
},
|
270
|
+
|
271
|
+
:"verb" => {
|
272
|
+
:"name" => :shift,
|
273
|
+
:"vector" => {:"...maximum_magnitude" => nil, direction: [0,-1]}
|
274
|
+
},
|
275
|
+
|
276
|
+
:"object" => {
|
277
|
+
:"src_square" => {
|
278
|
+
:"...attacked?" => nil,
|
279
|
+
:"...occupied!" => false,
|
280
|
+
:"area" => :all
|
281
|
+
},
|
282
|
+
:"dst_square" => {
|
283
|
+
:"...attacked?" => nil,
|
284
|
+
:"...occupied!" => false,
|
285
|
+
:"area" => :all
|
286
|
+
},
|
287
|
+
:"promotable_into_actors" => [:self]
|
274
288
|
}
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
},
|
289
|
-
|
290
|
-
:"verb" => {
|
291
|
-
:"name" => :shift,
|
292
|
-
:"vector" => {:"...maximum_magnitude" => nil, direction: [0,-1]}
|
293
|
-
},
|
294
|
-
|
295
|
-
:"object" => {
|
296
|
-
:"src_square" => {
|
297
|
-
:"...attacked?" => nil,
|
298
|
-
:"...occupied!" => false,
|
299
|
-
:"area" => :all
|
300
|
-
},
|
301
|
-
:"dst_square" => {
|
302
|
-
:"...attacked?" => nil,
|
303
|
-
:"...occupied!" => false,
|
304
|
-
:"area" => :all
|
305
|
-
},
|
306
|
-
:"promotable_into_actors" => [:self]
|
289
|
+
}
|
290
|
+
],
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
[
|
295
|
+
{
|
296
|
+
:"subject" => {
|
297
|
+
:"...ally?" => true,
|
298
|
+
:"actor" => :self,
|
299
|
+
:"state" => {
|
300
|
+
:"...last_moved_actor?" => nil,
|
301
|
+
:"...previous_moves_counter" => nil
|
307
302
|
}
|
308
303
|
},
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
:"
|
304
|
+
|
305
|
+
:"verb" => {
|
306
|
+
:"name" => :shift,
|
307
|
+
:"vector" => {:"...maximum_magnitude" => nil, direction: [0,-1]}
|
308
|
+
},
|
309
|
+
|
310
|
+
:"object" => {
|
311
|
+
:"src_square" => {
|
312
|
+
:"...attacked?" => nil,
|
313
|
+
:"...occupied!" => false,
|
314
|
+
:"area" => :all
|
315
|
+
},
|
316
|
+
:"dst_square" => {
|
317
|
+
:"...attacked?" => nil,
|
318
|
+
:"...occupied!" => false,
|
319
|
+
:"area" => :all
|
320
|
+
},
|
321
|
+
:"promotable_into_actors" => [:self]
|
322
|
+
}
|
323
|
+
},
|
324
|
+
{
|
325
|
+
:"subject" => {
|
326
|
+
:"...ally?" => true,
|
327
|
+
:"actor" => :self,
|
328
|
+
:"state" => {
|
329
|
+
:"...last_moved_actor?" => nil,
|
330
|
+
:"...previous_moves_counter" => nil
|
336
331
|
}
|
332
|
+
},
|
333
|
+
|
334
|
+
:"verb" => {
|
335
|
+
:"name" => :remove,
|
336
|
+
:"vector" => {:"...maximum_magnitude" => 1, direction: [0,-1]}
|
337
|
+
},
|
338
|
+
|
339
|
+
:"object" => {
|
340
|
+
:"src_square" => {
|
341
|
+
:"...attacked?" => nil,
|
342
|
+
:"...occupied!" => false,
|
343
|
+
:"area" => :all
|
344
|
+
},
|
345
|
+
:"dst_square" => {
|
346
|
+
:"...attacked?" => nil,
|
347
|
+
:"...occupied!" => :an_enemy_actor,
|
348
|
+
:"area" => :all
|
349
|
+
},
|
350
|
+
:"promotable_into_actors" => [:self]
|
337
351
|
}
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
},
|
352
|
-
|
353
|
-
:"verb" => {
|
354
|
-
:"name" => :shift,
|
355
|
-
:"vector" => {:"...maximum_magnitude" => nil, direction: [0,1]}
|
356
|
-
},
|
357
|
-
|
358
|
-
:"object" => {
|
359
|
-
:"src_square" => {
|
360
|
-
:"...attacked?" => nil,
|
361
|
-
:"...occupied!" => false,
|
362
|
-
:"area" => :all
|
363
|
-
},
|
364
|
-
:"dst_square" => {
|
365
|
-
:"...attacked?" => nil,
|
366
|
-
:"...occupied!" => false,
|
367
|
-
:"area" => :all
|
368
|
-
},
|
369
|
-
:"promotable_into_actors" => [:self]
|
352
|
+
}
|
353
|
+
],
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
[
|
358
|
+
{
|
359
|
+
:"subject" => {
|
360
|
+
:"...ally?" => true,
|
361
|
+
:"actor" => :self,
|
362
|
+
:"state" => {
|
363
|
+
:"...last_moved_actor?" => nil,
|
364
|
+
:"...previous_moves_counter" => nil
|
370
365
|
}
|
366
|
+
},
|
367
|
+
|
368
|
+
:"verb" => {
|
369
|
+
:"name" => :shift,
|
370
|
+
:"vector" => {:"...maximum_magnitude" => nil, direction: [0,1]}
|
371
|
+
},
|
372
|
+
|
373
|
+
:"object" => {
|
374
|
+
:"src_square" => {
|
375
|
+
:"...attacked?" => nil,
|
376
|
+
:"...occupied!" => false,
|
377
|
+
:"area" => :all
|
378
|
+
},
|
379
|
+
:"dst_square" => {
|
380
|
+
:"...attacked?" => nil,
|
381
|
+
:"...occupied!" => false,
|
382
|
+
:"area" => :all
|
383
|
+
},
|
384
|
+
:"promotable_into_actors" => [:self]
|
371
385
|
}
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
},
|
386
|
-
|
387
|
-
:"verb" => {
|
388
|
-
:"name" => :shift,
|
389
|
-
:"vector" => {:"...maximum_magnitude" => nil, direction: [0,1]}
|
390
|
-
},
|
391
|
-
|
392
|
-
:"object" => {
|
393
|
-
:"src_square" => {
|
394
|
-
:"...attacked?" => nil,
|
395
|
-
:"...occupied!" => false,
|
396
|
-
:"area" => :all
|
397
|
-
},
|
398
|
-
:"dst_square" => {
|
399
|
-
:"...attacked?" => nil,
|
400
|
-
:"...occupied!" => false,
|
401
|
-
:"area" => :all
|
402
|
-
},
|
403
|
-
:"promotable_into_actors" => [:self]
|
386
|
+
}
|
387
|
+
],
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
[
|
392
|
+
{
|
393
|
+
:"subject" => {
|
394
|
+
:"...ally?" => true,
|
395
|
+
:"actor" => :self,
|
396
|
+
:"state" => {
|
397
|
+
:"...last_moved_actor?" => nil,
|
398
|
+
:"...previous_moves_counter" => nil
|
404
399
|
}
|
405
400
|
},
|
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
|
-
:"
|
401
|
+
|
402
|
+
:"verb" => {
|
403
|
+
:"name" => :shift,
|
404
|
+
:"vector" => {:"...maximum_magnitude" => nil, direction: [0,1]}
|
405
|
+
},
|
406
|
+
|
407
|
+
:"object" => {
|
408
|
+
:"src_square" => {
|
409
|
+
:"...attacked?" => nil,
|
410
|
+
:"...occupied!" => false,
|
411
|
+
:"area" => :all
|
412
|
+
},
|
413
|
+
:"dst_square" => {
|
414
|
+
:"...attacked?" => nil,
|
415
|
+
:"...occupied!" => false,
|
416
|
+
:"area" => :all
|
417
|
+
},
|
418
|
+
:"promotable_into_actors" => [:self]
|
419
|
+
}
|
420
|
+
},
|
421
|
+
{
|
422
|
+
:"subject" => {
|
423
|
+
:"...ally?" => true,
|
424
|
+
:"actor" => :self,
|
425
|
+
:"state" => {
|
426
|
+
:"...last_moved_actor?" => nil,
|
427
|
+
:"...previous_moves_counter" => nil
|
433
428
|
}
|
429
|
+
},
|
430
|
+
|
431
|
+
:"verb" => {
|
432
|
+
:"name" => :remove,
|
433
|
+
:"vector" => {:"...maximum_magnitude" => 1, direction: [0,1]}
|
434
|
+
},
|
435
|
+
|
436
|
+
:"object" => {
|
437
|
+
:"src_square" => {
|
438
|
+
:"...attacked?" => nil,
|
439
|
+
:"...occupied!" => false,
|
440
|
+
:"area" => :all
|
441
|
+
},
|
442
|
+
:"dst_square" => {
|
443
|
+
:"...attacked?" => nil,
|
444
|
+
:"...occupied!" => :an_enemy_actor,
|
445
|
+
:"area" => :all
|
446
|
+
},
|
447
|
+
:"promotable_into_actors" => [:self]
|
434
448
|
}
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
},
|
449
|
-
|
450
|
-
:"verb" => {
|
451
|
-
:"name" => :shift,
|
452
|
-
:"vector" => {:"...maximum_magnitude" => nil, direction: [1,0]}
|
453
|
-
},
|
454
|
-
|
455
|
-
:"object" => {
|
456
|
-
:"src_square" => {
|
457
|
-
:"...attacked?" => nil,
|
458
|
-
:"...occupied!" => false,
|
459
|
-
:"area" => :all
|
460
|
-
},
|
461
|
-
:"dst_square" => {
|
462
|
-
:"...attacked?" => nil,
|
463
|
-
:"...occupied!" => false,
|
464
|
-
:"area" => :all
|
465
|
-
},
|
466
|
-
:"promotable_into_actors" => [:self]
|
449
|
+
}
|
450
|
+
],
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
[
|
455
|
+
{
|
456
|
+
:"subject" => {
|
457
|
+
:"...ally?" => true,
|
458
|
+
:"actor" => :self,
|
459
|
+
:"state" => {
|
460
|
+
:"...last_moved_actor?" => nil,
|
461
|
+
:"...previous_moves_counter" => nil
|
467
462
|
}
|
463
|
+
},
|
464
|
+
|
465
|
+
:"verb" => {
|
466
|
+
:"name" => :shift,
|
467
|
+
:"vector" => {:"...maximum_magnitude" => nil, direction: [1,0]}
|
468
|
+
},
|
469
|
+
|
470
|
+
:"object" => {
|
471
|
+
:"src_square" => {
|
472
|
+
:"...attacked?" => nil,
|
473
|
+
:"...occupied!" => false,
|
474
|
+
:"area" => :all
|
475
|
+
},
|
476
|
+
:"dst_square" => {
|
477
|
+
:"...attacked?" => nil,
|
478
|
+
:"...occupied!" => false,
|
479
|
+
:"area" => :all
|
480
|
+
},
|
481
|
+
:"promotable_into_actors" => [:self]
|
468
482
|
}
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
},
|
483
|
-
|
484
|
-
:"verb" => {
|
485
|
-
:"name" => :shift,
|
486
|
-
:"vector" => {:"...maximum_magnitude" => nil, direction: [1,0]}
|
487
|
-
},
|
488
|
-
|
489
|
-
:"object" => {
|
490
|
-
:"src_square" => {
|
491
|
-
:"...attacked?" => nil,
|
492
|
-
:"...occupied!" => false,
|
493
|
-
:"area" => :all
|
494
|
-
},
|
495
|
-
:"dst_square" => {
|
496
|
-
:"...attacked?" => nil,
|
497
|
-
:"...occupied!" => false,
|
498
|
-
:"area" => :all
|
499
|
-
},
|
500
|
-
:"promotable_into_actors" => [:self]
|
483
|
+
}
|
484
|
+
],
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
[
|
489
|
+
{
|
490
|
+
:"subject" => {
|
491
|
+
:"...ally?" => true,
|
492
|
+
:"actor" => :self,
|
493
|
+
:"state" => {
|
494
|
+
:"...last_moved_actor?" => nil,
|
495
|
+
:"...previous_moves_counter" => nil
|
501
496
|
}
|
502
497
|
},
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
:"
|
498
|
+
|
499
|
+
:"verb" => {
|
500
|
+
:"name" => :shift,
|
501
|
+
:"vector" => {:"...maximum_magnitude" => nil, direction: [1,0]}
|
502
|
+
},
|
503
|
+
|
504
|
+
:"object" => {
|
505
|
+
:"src_square" => {
|
506
|
+
:"...attacked?" => nil,
|
507
|
+
:"...occupied!" => false,
|
508
|
+
:"area" => :all
|
509
|
+
},
|
510
|
+
:"dst_square" => {
|
511
|
+
:"...attacked?" => nil,
|
512
|
+
:"...occupied!" => false,
|
513
|
+
:"area" => :all
|
514
|
+
},
|
515
|
+
:"promotable_into_actors" => [:self]
|
516
|
+
}
|
517
|
+
},
|
518
|
+
{
|
519
|
+
:"subject" => {
|
520
|
+
:"...ally?" => true,
|
521
|
+
:"actor" => :self,
|
522
|
+
:"state" => {
|
523
|
+
:"...last_moved_actor?" => nil,
|
524
|
+
:"...previous_moves_counter" => nil
|
530
525
|
}
|
526
|
+
},
|
527
|
+
|
528
|
+
:"verb" => {
|
529
|
+
:"name" => :remove,
|
530
|
+
:"vector" => {:"...maximum_magnitude" => 1, direction: [1,0]}
|
531
|
+
},
|
532
|
+
|
533
|
+
:"object" => {
|
534
|
+
:"src_square" => {
|
535
|
+
:"...attacked?" => nil,
|
536
|
+
:"...occupied!" => false,
|
537
|
+
:"area" => :all
|
538
|
+
},
|
539
|
+
:"dst_square" => {
|
540
|
+
:"...attacked?" => nil,
|
541
|
+
:"...occupied!" => :an_enemy_actor,
|
542
|
+
:"area" => :all
|
543
|
+
},
|
544
|
+
:"promotable_into_actors" => [:self]
|
531
545
|
}
|
532
|
-
|
533
|
-
]
|
534
|
-
|
546
|
+
}
|
547
|
+
]
|
548
|
+
].hash
|
535
549
|
end
|
536
550
|
|
537
|
-
it '
|
538
|
-
|
551
|
+
it 'raises an error' do
|
552
|
+
-> { subject.load 'Zm9vYmFy' }.must_raise ArgumentError
|
539
553
|
end
|
540
554
|
end
|
541
|
-
|
542
|
-
it 'raises an error' do
|
543
|
-
-> { Sashite::GGN::GameplayIntoBase64.new('foobar') }.must_raise ArgumentError
|
544
|
-
end
|
545
555
|
end
|