Package parpg :: Module application :: Class ApplicationListener
[hide private]
[frames] | no frames]

Class ApplicationListener

source code

                                       object --+    
                                                |    
        common.listeners.key_listener.KeyListener --+
                                                    |
                                       object --+   |
                                                |   |
    common.listeners.mouse_listener.MouseListener --+
                                                    |
                                       object --+   |
                                                |   |
common.listeners.console_executor.ConsoleExecuter --+
                                                    |
                                       object --+   |
                                                |   |
common.listeners.command_listener.CommandListener --+
                                                    |
                                       object --+   |
                                                |   |
  common.listeners.widget_listener.WidgetListener --+
                                                    |
                                                   ApplicationListener

Basic listener for PARPG

Instance Methods [hide private]
 
__init__(self, event_listener, engine, view, model)
Initialize the instance.
source code
 
quitGame(self)
Forces a quit game on next cycle.
source code
 
onConsoleCommand(self, command)
Called on every console comand, delegates calls to the a console object, implementing the callbacks
source code
 
onCommand(self, command)
Enables the game to be closed via the 'X' button on the window frame
source code

Inherited from common.listeners.key_listener.KeyListener: attach, detach, keyPressed, keyReleased

Inherited from common.listeners.mouse_listener.MouseListener: mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMovedDown, mouseWheelMovedUp

Inherited from common.listeners.console_executor.ConsoleExecuter: onToolsClick

Inherited from common.listeners.widget_listener.WidgetListener: onWidgetAction

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, event_listener, engine, view, model)
(Constructor)

source code 

Initialize the instance.

Parameters:
  • engine (fife.engine) - ???
  • view (viewbase.ViewBase) - View that draws the current state
  • model (GameModel) - The game model
Overrides: object.__init__

quitGame(self)

source code 

Forces a quit game on next cycle.

Returns:
None

onConsoleCommand(self, command)

source code 

Called on every console comand, delegates calls to the a console object, implementing the callbacks

Parameters:
  • command (string) - the command to run
Returns:
result
Overrides: common.listeners.console_executor.ConsoleExecuter.onConsoleCommand

onCommand(self, command)

source code 

Enables the game to be closed via the 'X' button on the window frame

Parameters:
  • command (fife.Command) - The command to read.
Returns:
None
Overrides: common.listeners.command_listener.CommandListener.onCommand