Mercurial > boomslang
comparison gamelib/state.py @ 201:9531a22721d1
Add support for lists of results
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Thu, 26 Aug 2010 10:54:25 +0200 |
parents | 738608e90e9c |
children | eb101b6fb3dd |
comparison
equal
deleted
inserted
replaced
200:7bedca2376f5 | 201:9531a22721d1 |
---|---|
31 self.sound.play() | 31 self.sound.play() |
32 if self.message: | 32 if self.message: |
33 scene_widget.show_message(self.message) | 33 scene_widget.show_message(self.message) |
34 if self.detail_view: | 34 if self.detail_view: |
35 scene_widget.show_detail(self.detail_view) | 35 scene_widget.show_detail(self.detail_view) |
36 | |
37 | |
38 def handle_result(result, scene_widget): | |
39 """Handle dealing with result or result sequences""" | |
40 if result: | |
41 if hasattr(result, 'process'): | |
42 result.process(scene_widget) | |
43 else: | |
44 for res in result: | |
45 res.process(scene_widget) | |
36 | 46 |
37 def initial_state(): | 47 def initial_state(): |
38 """Load the initial state.""" | 48 """Load the initial state.""" |
39 state = State() | 49 state = State() |
40 state.load_scenes("cryo") | 50 state.load_scenes("cryo") |