From 07ba242ba399bfd5e8831a041c1bfa4a36200915 Mon Sep 17 00:00:00 2001 From: Peter Ward Date: Mon, 7 Apr 2014 20:27:18 +1000 Subject: render ghost towns correctly --- robots/cursesviewer.py | 9 ++++++--- 1 file 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) -- cgit v1.2.3