Mercurial > sypikslang
diff gamelib/tests/repl_game.py @ 26:5d699b1f7188
Better REPL game.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sun, 06 May 2012 19:24:52 +0200 |
parents | f6a3b213857b |
children | 2f7d8f908de0 |
line wrap: on
line diff
--- a/gamelib/tests/repl_game.py Sun May 06 19:21:06 2012 +0200 +++ b/gamelib/tests/repl_game.py Sun May 06 19:24:52 2012 +0200 @@ -11,14 +11,20 @@ self.display_state() def display_state(self): - print "Game:", self.game + print "Points:", self.game.points print "Science:" + self.science = [] for science in self.game.lab.science: - print " %s %s (%s)" % ( - "*" if science.can_spend(self.game.lab) else "-", - science.NAME, science.points) + if science.can_spend(self.game.lab): + self.science.append(science) + print " %s. %s (%s)" % ( + len(self.science), science.NAME, science.points) + else: + print " -- %s (%s)" % (science.NAME, science.points) def next_turn(self, research_list, missions): + assert not missions, "Missions not currently supported." + research_list = [self.science[i - 1] for i in research_list] self.game.cur_allocation.extend(research_list) self.game.cur_missions.extend(missions) self.game.end_turn()