FIFE  2008.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
FIFE::EventManager Class Reference

#include <eventmanager.h>

Inheritance diagram for FIFE::EventManager:
Inheritance graph
Collaboration diagram for FIFE::EventManager:
Collaboration graph

Public Member Functions

 EventManager ()
 
virtual ~EventManager ()
 
void addCommandListener (ICommandListener *listener)
 
void addCommandListenerFront (ICommandListener *listener)
 
void removeCommandListener (ICommandListener *listener)
 
void dispatchCommand (Command &command)
 
void addKeyListener (IKeyListener *listener)
 
void addKeyListenerFront (IKeyListener *listener)
 
void removeKeyListener (IKeyListener *listener)
 
void addMouseListener (IMouseListener *listener)
 
void addMouseListenerFront (IMouseListener *listener)
 
void removeMouseListener (IMouseListener *listener)
 
void addSdlEventListener (ISdlEventListener *listener)
 
void addSdlEventListenerFront (ISdlEventListener *listener)
 
void removeSdlEventListener (ISdlEventListener *listener)
 
EventSourceType getEventSourceType ()
 
void processEvents ()
 
void setMouseSensitivity (float sensitivity)
 
float getMouseSensitivity () const
 
void setMouseAcceleration (bool acceleration)
 
bool getMouseAcceleration () const
 

Detailed Description

Event Manager manages all events related to FIFE

Definition at line 66 of file eventmanager.h.

Constructor & Destructor Documentation

FIFE::EventManager::EventManager ( )

Constructor.

Definition at line 46 of file eventmanager.cpp.

FIFE::EventManager::~EventManager ( )
virtual

Destructor

Definition at line 65 of file eventmanager.cpp.

Member Function Documentation

void FIFE::EventManager::addCommandListener ( ICommandListener listener)
virtual

Adds a listener to the back of the listener deque Listener will be notified via the corresponding events

Parameters
listenerlistener to add

Implements FIFE::ICommandController.

Definition at line 78 of file eventmanager.cpp.

void FIFE::EventManager::addCommandListenerFront ( ICommandListener listener)
virtual

Adds a listener to the front of the listener deque Listener will be notified via the corresponding events

Parameters
listenerlistener to add

Implements FIFE::ICommandController.

Definition at line 82 of file eventmanager.cpp.

void FIFE::EventManager::addKeyListener ( IKeyListener listener)
virtual

Adds a listener to the back of the listener deque Listener will be notified via the corresponding events

Parameters
listenerlistener to add

Implements FIFE::IKeyController.

Definition at line 90 of file eventmanager.cpp.

void FIFE::EventManager::addKeyListenerFront ( IKeyListener listener)
virtual

Adds a listener to the front of the listener deque Listener will be notified via the corresponding events

Parameters
listenerlistener to add

Implements FIFE::IKeyController.

Definition at line 94 of file eventmanager.cpp.

void FIFE::EventManager::addMouseListener ( IMouseListener listener)
virtual

Adds a listener to the back of the listener deque Listener will be notified via the corresponding events

Parameters
listenerlistener to add

Implements FIFE::IMouseController.

Definition at line 102 of file eventmanager.cpp.

void FIFE::EventManager::addMouseListenerFront ( IMouseListener listener)
virtual

Adds a listener to the front of the listener deque Listener will be notified via the corresponding events

Parameters
listenerlistener to add

Implements FIFE::IMouseController.

Definition at line 106 of file eventmanager.cpp.

void FIFE::EventManager::addSdlEventListener ( ISdlEventListener listener)
virtual

Adds a listener to the back of the listener deque Listener will be notified via the corresponding events

Parameters
listenerlistener to add

Implements FIFE::ISdlEventController.

Definition at line 114 of file eventmanager.cpp.

void FIFE::EventManager::addSdlEventListenerFront ( ISdlEventListener listener)
virtual

Adds a listener to the front of the listener deque Listener will be notified via the corresponding events

Parameters
listenerlistener to add

Implements FIFE::ISdlEventController.

Definition at line 118 of file eventmanager.cpp.

void FIFE::EventManager::dispatchCommand ( Command command)
virtual

Use this method to send command to command listeners

Parameters
commandcommand to dispatch

Implements FIFE::ICommandController.

Definition at line 126 of file eventmanager.cpp.

References FIFE::Command::isConsumed().

Referenced by processEvents().

Here is the caller graph for this function:

EventSourceType FIFE::EventManager::getEventSourceType ( )
virtual

Gets the source type of this event

Returns
source type of this event

Implements FIFE::IEventSource.

Definition at line 625 of file eventmanager.cpp.

bool FIFE::EventManager::getMouseAcceleration ( ) const

Gets mouse acceleration

Definition at line 650 of file eventmanager.cpp.

float FIFE::EventManager::getMouseSensitivity ( ) const

Gets mouse sensitivity

Definition at line 642 of file eventmanager.cpp.

void FIFE::EventManager::processEvents ( )

Process the SDL event queue. This is to be called only by the engine itself once per frame. It passes appropriate events to their listeners

Definition at line 358 of file eventmanager.cpp.

References dispatchCommand(), and FIFE::Command::setSource().

Referenced by FIFE::Engine::initializePumping(), and FIFE::Engine::pump().

Here is the caller graph for this function:

void FIFE::EventManager::removeCommandListener ( ICommandListener listener)
virtual

Removes an added listener from the controller. Listener will not be notified anymore via the corresponding events

Parameters
listenerlistener to remove

Implements FIFE::ICommandController.

Definition at line 86 of file eventmanager.cpp.

void FIFE::EventManager::removeKeyListener ( IKeyListener listener)
virtual

Removes an added listener from the controller. Listener will not be notified anymore via the corresponding events

Parameters
listenerlistener to remove

Implements FIFE::IKeyController.

Definition at line 98 of file eventmanager.cpp.

void FIFE::EventManager::removeMouseListener ( IMouseListener listener)
virtual

Removes an added listener from the controller. Listener will not be notified anymore via the corresponding events

Parameters
listenerlistener to remove

Implements FIFE::IMouseController.

Definition at line 110 of file eventmanager.cpp.

void FIFE::EventManager::removeSdlEventListener ( ISdlEventListener listener)
virtual

Removes an added listener from the controller. Listener will not be notified anymore via the corresponding events

Parameters
listenerlistener to remove

Implements FIFE::ISdlEventController.

Definition at line 122 of file eventmanager.cpp.

void FIFE::EventManager::setMouseAcceleration ( bool  acceleration)

Sets mouse acceleration if mouse acceleration is enabled, then the mouse sensitivity is used as speed max.

Definition at line 646 of file eventmanager.cpp.

Referenced by FIFE::Engine::init().

Here is the caller graph for this function:

void FIFE::EventManager::setMouseSensitivity ( float  sensitivity)

Sets mouse sensitivity The sensitivity is limited to the range -0.99 - 10.0.

Definition at line 633 of file eventmanager.cpp.

Referenced by FIFE::Engine::init().

Here is the caller graph for this function:


The documentation for this class was generated from the following files: