comparison gamelib/level.py @ 428:a356e57529ea

buildings cost wood
author Adrianna Pińska <adrianna.pinska@gmail.com>
date Sat, 21 Nov 2009 16:21:38 +0000
parents 1e24eedbf40f
children d5e4959cfe7a
comparison
equal deleted inserted replaced
427:e89a1afe4e84 428:a356e57529ea
31 'turn limit' : constants.DEFAULT_TURN_LIMIT, 31 'turn limit' : constants.DEFAULT_TURN_LIMIT,
32 'goal' : constants.DEFAULT_GOAL_DESC, 32 'goal' : constants.DEFAULT_GOAL_DESC,
33 'max foxes' : constants.DEFAULT_MAX_FOXES, 33 'max foxes' : constants.DEFAULT_MAX_FOXES,
34 'min foxes' : 0, 34 'min foxes' : 0,
35 'starting cash' : constants.DEFAULT_STARTING_CASH, 35 'starting cash' : constants.DEFAULT_STARTING_CASH,
36 'starting wood' : constants.DEFAULT_STARTING_WOOD,
36 } 37 }
37 # Add default fox weightings 38 # Add default fox weightings
38 for animal, prob in DEFAULT_FOX_WEIGHTINGS: 39 for animal, prob in DEFAULT_FOX_WEIGHTINGS:
39 defaults[animal.CONFIG_NAME] = prob 40 defaults[animal.CONFIG_NAME] = prob
40 config = RawConfigParser(defaults) 41 config = RawConfigParser(defaults)
52 self.sell_price_chicken = config.getint('Game values', 'sell price chicken') 53 self.sell_price_chicken = config.getint('Game values', 'sell price chicken')
53 self.sell_price_egg = config.getint('Game values', 'sell price egg') 54 self.sell_price_egg = config.getint('Game values', 'sell price egg')
54 self.sell_price_dead_fox = config.getint('Game values', 55 self.sell_price_dead_fox = config.getint('Game values',
55 'sell price dead fox') 56 'sell price dead fox')
56 self.starting_cash = config.getint('Game values', 'starting cash') 57 self.starting_cash = config.getint('Game values', 'starting cash')
58 self.starting_wood = config.getint('Game values', 'starting wood')
57 self.fox_weightings = [] 59 self.fox_weightings = []
58 for animal, _prob in DEFAULT_FOX_WEIGHTINGS: 60 for animal, _prob in DEFAULT_FOX_WEIGHTINGS:
59 self.fox_weightings.append((animal, config.getint('Fox probablities', 61 self.fox_weightings.append((animal, config.getint('Fox probablities',
60 animal.CONFIG_NAME))) 62 animal.CONFIG_NAME)))
61 63