Mercurial > pyntnclick
diff pyntnclick/main.py @ 750:ef4bda7d623d pyntnclick
Better state and inventory management.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sun, 20 Jan 2013 20:20:36 +0200 |
parents | a453731e4531 |
children | f4853f817a7a |
line wrap: on
line diff
--- a/pyntnclick/main.py Sun Jan 20 18:57:17 2013 +0200 +++ b/pyntnclick/main.py Sun Jan 20 20:20:36 2013 +0200 @@ -45,7 +45,7 @@ RESOURCE_MODULE = 'data' SCENE_MODULE = 'gamelib.scenes' - def __init__(self, custom_data_cls=None): + def __init__(self): if self.INITIAL_SCENE is None: raise GameDescriptionError("A game must have an initial scene.") if not self.SCENE_LIST: @@ -58,7 +58,6 @@ self._scene_list = self.SCENE_LIST self._resource_module = self.RESOURCE_MODULE self._debug_rects = False - self._custom_data_cls = custom_data_cls self._screens = self.SCREENS.copy() self._screens['game'] = GameScreen self.resource = Resources(self._resource_module) @@ -70,14 +69,15 @@ def initial_state(self): """Create a copy of the initial game state.""" initial_state = state.Game(self) - if self._custom_data_cls: - initial_state.set_custom_data(self._custom_data_cls()) initial_state.set_debug_rects(self._debug_rects) for scene in self._scene_list: initial_state.load_scenes(scene) initial_state.change_scene(self._initial_scene) return initial_state + def game_state(self): + return state.GameState() + def game_constants(self): return GameConstants()