berlin-ai 0.0.23 → 0.0.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/ai/fake.rb +4 -2
  2. data/lib/version.rb +1 -1
  3. metadata +1 -1
data/lib/ai/fake.rb CHANGED
@@ -112,7 +112,7 @@ module Berlin
112
112
 
113
113
  def initialize(state)
114
114
  js = state.as_json
115
- @player_ids = js.map{ |n| n['player_id'] }.uniq
115
+ @player_ids = js.map{ |n| n['player_id'] }.uniq.compact
116
116
 
117
117
  js.each do |node|
118
118
  id = node['node_id'].to_s.rjust(2)
@@ -129,7 +129,7 @@ module Berlin
129
129
 
130
130
  def as_display
131
131
  ## The map is fully dynamic
132
- <<-MAP
132
+ map = <<-MAP
133
133
  ____ ____ ____
134
134
  / \\ / \\ / \\
135
135
  | #{n1.id} |---------| #{n2.id} |---------| #{n3.id} |
@@ -150,6 +150,8 @@ module Berlin
150
150
  | #{n6.ns} | | #{n7.ns} | | #{n8.ns} |
151
151
  \\____/ \\____/ \\____/
152
152
  MAP
153
+
154
+ [map, *@player_ids.map{ |id| id.to_s.foreground(color(id)) }].join("\n")
153
155
  end
154
156
  end
155
157
 
data/lib/version.rb CHANGED
@@ -2,7 +2,7 @@ module Berlin
2
2
  module AI
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- BUILD = 23
5
+ BUILD = 24
6
6
 
7
7
  VERSION = "#{MAJOR}.#{MINOR}.#{BUILD}"
8
8
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: berlin-ai
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.23
5
+ version: 0.0.24
6
6
  platform: ruby
7
7
  authors:
8
8
  - Christian Blais