diff gamelib/scenes/game_widgets.py @ 603:3ce19d33b51f pyntnclick

Rename state to game to not cause confusion with the other state
author Neil Muller <neil@dip.sun.ac.za>
date Sat, 11 Feb 2012 20:09:47 +0200
parents 098ea4ea0d0d
children c77d6aa29bee
line wrap: on
line diff
--- a/gamelib/scenes/game_widgets.py	Sat Feb 11 20:05:22 2012 +0200
+++ b/gamelib/scenes/game_widgets.py	Sat Feb 11 20:09:47 2012 +0200
@@ -19,7 +19,7 @@
 
     def interact_without(self):
         """Go to map."""
-        self.state.set_current_scene("map")
+        self.game.set_current_scene("map")
 
     def get_description(self):
         return 'An open doorway leads to the rest of the ship.'
@@ -45,7 +45,7 @@
     }
 
     def get_description(self):
-        status = self.state.scenes['bridge'].get_data('ai status')
+        status = self.game.scenes['bridge'].get_data('ai status')
         if status == 'online':
             return "A security camera watches over the room"
         elif status == 'looping':
@@ -55,19 +55,19 @@
             return "The security camera is powered down"
 
     def is_interactive(self, tool=None):
-        return self.state.scenes['bridge'].get_data('ai status') == 'online'
+        return self.game.scenes['bridge'].get_data('ai status') == 'online'
 
     def interact_with_escher_poster(self, item):
         # Order matters here, because of helper function
-        if self.state.scenes['bridge'].get_data('ai status') == 'online':
+        if self.game.scenes['bridge'].get_data('ai status') == 'online':
             ai_response = make_jim_dialog("3D scene reconstruction failed."
                     " Critical error. Entering emergency shutdown.",
-                    self.state)
-            self.state.scenes['bridge'].set_data('ai status', 'looping')
+                    self.game)
+            self.game.scenes['bridge'].set_data('ai status', 'looping')
             return ai_response
 
     def animate(self):
-        ai_status = self.state.scenes['bridge'].get_data('ai status')
+        ai_status = self.game.scenes['bridge'].get_data('ai status')
         if ai_status != self.get_data('status'):
             self.set_data('status', ai_status)
             self.set_interact(ai_status)