comparison gamelib/tests/repl_game.py @ 28:2f7d8f908de0

Better REPL client.
author Jeremy Thurgood <firxen@gmail.com>
date Sun, 06 May 2012 19:45:01 +0200
parents 5d699b1f7188
children 355aa7592492
comparison
equal deleted inserted replaced
27:4d9610c59efa 28:2f7d8f908de0
9 def _begin_turn(self): 9 def _begin_turn(self):
10 self.game.start_turn() 10 self.game.start_turn()
11 self.display_state() 11 self.display_state()
12 12
13 def display_state(self): 13 def display_state(self):
14 print "-" * 50
15 print "Repute:", self.game.reputation
16 print "Moneys:", self.game.money
14 print "Points:", self.game.points 17 print "Points:", self.game.points
18 print ""
15 print "Science:" 19 print "Science:"
16 self.science = [] 20 self.science = []
17 for science in self.game.lab.science: 21 for science in self.game.lab.science:
18 if science.can_spend(self.game.lab): 22 if science.can_spend(self.game.lab):
19 self.science.append(science) 23 self.science.append(science)
20 print " %s. %s (%s)" % ( 24 print " %s. %s (%s)" % (
21 len(self.science), science.NAME, science.points) 25 len(self.science), science.NAME, science.points)
22 else: 26 else:
23 print " -- %s (%s)" % (science.NAME, science.points) 27 print " -- %s (%s)" % (science.NAME, science.points)
28 print ""
29 print "Missions:"
30 print " * Coming soon!"
31 print "-" * 50
24 32
25 def next_turn(self, research_list, missions): 33 def next_turn(self, research_list, missions):
26 assert not missions, "Missions not currently supported." 34 assert not missions, "Missions not currently supported."
27 research_list = [self.science[i - 1] for i in research_list] 35 research_list = [self.science[i - 1] for i in research_list]
28 self.game.cur_allocation.extend(research_list) 36 self.game.cur_allocation.extend(research_list)