berlin-ai 0.0.36 → 0.0.37
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +2 -2
- data/lib/ai/map_internal.rb +1 -1
- data/lib/ai/node_internal.rb +5 -4
- data/lib/version.rb +1 -1
- metadata +1 -1
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
berlin-ai (0.0.
|
4
|
+
berlin-ai (0.0.33)
|
5
5
|
rainbow (~> 1.1.4)
|
6
6
|
sinatra (= 1.4.3)
|
7
7
|
sinatra-contrib (= 1.4.1)
|
@@ -17,7 +17,7 @@ GEM
|
|
17
17
|
eventmachine (1.0.3)
|
18
18
|
method_source (0.8.2)
|
19
19
|
minitest (4.7.5)
|
20
|
-
multi_json (1.
|
20
|
+
multi_json (1.8.0)
|
21
21
|
pry (0.9.12.2)
|
22
22
|
coderay (~> 1.0.5)
|
23
23
|
method_source (~> 0.8)
|
data/lib/ai/map_internal.rb
CHANGED
@@ -21,7 +21,7 @@ module Berlin
|
|
21
21
|
# the node and how many soldiers there is. We'll get back to that later.
|
22
22
|
# map['nodes'] => [{:id => STRING}, ...]
|
23
23
|
data['nodes'].each do |node|
|
24
|
-
node_data = node.merge(types[node['type']]).merge(
|
24
|
+
node_data = node.merge(types[node['type']]).merge('map' => map)
|
25
25
|
map.nodes_hash[node['id']] = Berlin::AI::Node.parse(node_data)
|
26
26
|
end
|
27
27
|
|
data/lib/ai/node_internal.rb
CHANGED
@@ -6,10 +6,11 @@ module Berlin
|
|
6
6
|
def parse(data)
|
7
7
|
node = Node.new
|
8
8
|
|
9
|
-
node.id = data
|
10
|
-
node.
|
11
|
-
node.
|
12
|
-
node.
|
9
|
+
node.id = data.fetch('id')
|
10
|
+
node.map = data.fetch('map')
|
11
|
+
node.type = data.fetch('type')
|
12
|
+
node.points = data.fetch('points')
|
13
|
+
node.soldiers_per_turn = data.fetch('soldiers_per_turn')
|
13
14
|
|
14
15
|
node
|
15
16
|
end
|
data/lib/version.rb
CHANGED