comparison gamelib/level.py @ 505:3ed6c011106d

Switch to classmethod decorators.
author Simon Cross <hodgestar@gmail.com>
date Thu, 26 Nov 2009 22:34:58 +0000
parents d5e4959cfe7a
children
comparison
equal deleted inserted replaced
504:393e30ea0165 505:3ed6c011106d
65 self.fox_weightings = [] 65 self.fox_weightings = []
66 for animal, _prob in DEFAULT_FOX_WEIGHTINGS: 66 for animal, _prob in DEFAULT_FOX_WEIGHTINGS:
67 self.fox_weightings.append((animal, config.getint('Fox probablities', 67 self.fox_weightings.append((animal, config.getint('Fox probablities',
68 animal.CONFIG_NAME))) 68 animal.CONFIG_NAME)))
69 69
70 @classmethod
70 def unsimplify(cls, *args, **kwargs): 71 def unsimplify(cls, *args, **kwargs):
71 """Override default Simplifiable unsimplification.""" 72 """Override default Simplifiable unsimplification."""
72 obj = super(Level, cls).unsimplify(*args, **kwargs) 73 obj = super(Level, cls).unsimplify(*args, **kwargs)
73 obj.__init__(obj.config_name) 74 obj.__init__(obj.config_name)
74 return obj 75 return obj
75 unsimplify = classmethod(unsimplify)
76 76
77 # Utility functions, so we can make things more flexible later 77 # Utility functions, so we can make things more flexible later
78 78
79 def is_last_day(self, days): 79 def is_last_day(self, days):
80 """Check if we're the last day""" 80 """Check if we're the last day"""