Mercurial > parpg-core
comparison src/parpg/controllerbase.py @ 30:94cb5843dcbb
Modifications to use the grease manager and modes
author | KarstenBock@gmx.net |
---|---|
date | Tue, 12 Jul 2011 12:31:53 +0200 |
parents | d60f1dab8469 |
children | 29869273f9e1 |
comparison
equal
deleted
inserted
replaced
29:ad18c3f912c5 | 30:94cb5843dcbb |
---|---|
15 from fife import fife | 15 from fife import fife |
16 | 16 |
17 from parpg.common.listeners.key_listener import KeyListener | 17 from parpg.common.listeners.key_listener import KeyListener |
18 from parpg.common.listeners.mouse_listener import MouseListener | 18 from parpg.common.listeners.mouse_listener import MouseListener |
19 from parpg.common.listeners.command_listener import CommandListener | 19 from parpg.common.listeners.command_listener import CommandListener |
20 from parpg.world import World | |
20 | 21 |
21 class ControllerBase(KeyListener, MouseListener, CommandListener): | 22 class ControllerBase(World, KeyListener, MouseListener, CommandListener): |
22 """Base of Controllers""" | 23 """Base of Controllers""" |
23 def __init__(self, | 24 def __init__(self, |
24 engine, | 25 engine, |
25 view, | 26 view, |
26 model, | 27 model, |
39 @type settings: fife.extensions.fife_settings.Setting | 40 @type settings: fife.extensions.fife_settings.Setting |
40 ''' | 41 ''' |
41 KeyListener.__init__(self, application.event_listener) | 42 KeyListener.__init__(self, application.event_listener) |
42 MouseListener.__init__(self, application.event_listener) | 43 MouseListener.__init__(self, application.event_listener) |
43 CommandListener.__init__(self, application.event_listener) | 44 CommandListener.__init__(self, application.event_listener) |
45 World.__init__(self) | |
44 self.engine = engine | 46 self.engine = engine |
45 self.event_manager = engine.getEventManager() | 47 self.event_manager = engine.getEventManager() |
46 self.view = view | 48 self.view = view |
47 self.model = model | 49 self.model = model |
48 self.application = application | 50 self.application = application |
83 """Reset cursor to default image. | 85 """Reset cursor to default image. |
84 @return: None""" | 86 @return: None""" |
85 image = '/'.join(['gui/cursors/', | 87 image = '/'.join(['gui/cursors/', |
86 self.model.settings.parpg.CursorDefault]) | 88 self.model.settings.parpg.CursorDefault]) |
87 self.setMouseCursor(image, image) | 89 self.setMouseCursor(image, image) |
88 | |
89 def onStop(self): | |
90 """Called when the controller is removed from the list""" | |
91 pass | |
92 | |
93 def pump(self): | |
94 """This method gets called every frame""" | |
95 pass | |
96 | 90 |