diff pyntnclick/state.py @ 560:28f03563f4db pyntnclick

Provide stubby access to sound and resource object from GameDescription on state and scene objects.
author Simon Cross <hodgestar+bzr@gmail.com>
date Sat, 11 Feb 2012 14:47:44 +0200
parents 99a1420097df
children b84534a1bd2e
line wrap: on
line diff
--- a/pyntnclick/state.py	Sat Feb 11 14:42:24 2012 +0200
+++ b/pyntnclick/state.py	Sat Feb 11 14:47:44 2012 +0200
@@ -62,7 +62,9 @@
     * items
     * scenes
     """
-    def __init__(self):
+    def __init__(self, gd):
+        # game description
+        self.gd = gd
         # map of scene name -> Scene object
         self.scenes = {}
         # map of detail view name -> DetailView object
@@ -238,6 +240,8 @@
         self.name = self.NAME if self.NAME is not None else self.FOLDER
         # link back to state object
         self.state = state
+        self.sound = state.gd.sound
+        self.resource = state.gd.resource
         # map of thing names -> Thing objects
         self.things = {}
         self._background = None