berlin-ai 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ai/map.rb +2 -2
- data/lib/berlin-ai.rb +9 -1
- data/lib/version.rb +1 -1
- metadata +3 -3
data/lib/ai/map.rb
CHANGED
@@ -37,10 +37,10 @@ module Berlin
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
#
|
40
|
+
# Returns an array of all owned nodes
|
41
41
|
def owned_nodes
|
42
42
|
@nodes.select do |id, node|
|
43
|
-
node.
|
43
|
+
node.owned_by? player_id
|
44
44
|
end.values
|
45
45
|
end
|
46
46
|
|
data/lib/berlin-ai.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'optparse'
|
1
2
|
require 'sinatra'
|
2
3
|
require 'yajl/json_gem'
|
3
4
|
|
@@ -5,7 +6,14 @@ require 'yajl/json_gem'
|
|
5
6
|
require File.expand_path( File.dirname( __FILE__ ) ) + "/ai/#{file}"
|
6
7
|
end
|
7
8
|
|
8
|
-
#
|
9
|
+
# Parse options
|
10
|
+
OptionParser.new do |opts|
|
11
|
+
opts.on("-p N", Integer, "Set running port to N") do |p|
|
12
|
+
set :port, p
|
13
|
+
end
|
14
|
+
end.parse!
|
15
|
+
|
16
|
+
# Sinatra options
|
9
17
|
set :app_file, $0
|
10
18
|
|
11
19
|
post '/' do
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: berlin-ai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 9
|
10
|
+
version: 0.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christian Blais
|