summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Ward <peteraward@gmail.com>2014-04-07 20:27:18 +1000
committerPeter Ward <peteraward@gmail.com>2014-04-07 20:27:18 +1000
commit07ba242ba399bfd5e8831a041c1bfa4a36200915 (patch)
tree78e7e61042607703d46d8a96fdcdcf771effabd7
parent7b40a364633cca5a5e4d70763012fd033e7bae27 (diff)
render ghost towns correctly
-rw-r--r--robots/cursesviewer.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/robots/cursesviewer.py b/robots/cursesviewer.py
index af0b87a..4221117 100644
--- a/robots/cursesviewer.py
+++ b/robots/cursesviewer.py
@@ -24,7 +24,7 @@ class CursesViewer:
game.state.players,
colours,
))
- self.player_colours['*'] = 'white'
+ self.player_colours[City.GHOST] = 'white'
def draw_board(self, state):
print(self.terminal.clear, end='')
@@ -37,7 +37,10 @@ class CursesViewer:
for x, cell in enumerate(row):
value = ' '
- background = self.player_colours.get(cell['allegiance'])
+ if cell['city'] == City.GHOST:
+ background = 'white'
+ else:
+ background = self.player_colours.get(cell['allegiance'])
if cell['robots']:
(robot_owner, energy), = cell['robots']
@@ -67,7 +70,7 @@ class CursesViewer:
print(Box.BL + Box.H * width + Box.BR)
def run(self):
- limiter = rate_limit(20)
+ limiter = rate_limit(10)
for state in self.game:
next(limiter)