Class EventListener¶
Defined in File events.h
Inheritance Relationships¶
Derived Types¶
public BlamRendering::RenderStack::ConsoleUI
(Class ConsoleUI)public BlamRendering::RenderStack::DebugMenu
(Class DebugMenu)
Class Documentation¶
-
class
EventListener
¶ Class representing an Event Listener.
Event listeners are used to receive event notifications. They can subscribe and unsubscribe from any number of event types.
The class is intended to be used as an interface.
Subclassed by BlamRendering::RenderStack::ConsoleUI, BlamRendering::RenderStack::DebugMenu
Public Functions
-
void
Subscribe
(EventType type)¶ Subscribes to an event type.
This will cause the listener to recieve notifications about the specified event type.
- Parameters
type
: - The event type to subscribe to.
-
std::vector<EventType>
getSubscribedEvents
()¶ Retrieves the list of subscribed event types.
- Return
The list of subscribed event types.
-
bool
isSubscribed
(EventType type)¶ Determines whether or not the listener is subscribed to the specified event type.
- Return
Whether or not the listener is subscribed to the given type.
- Parameters
type
: - The type to check against.
-
void
SetPriority
(int new_priority)¶ Sets the priority of the listener.
Higher priority listeners will recieve event notifications before lower priority listeners.
- Parameters
new_priority
: - The new priority of the listener.
-
int
GetPriority
()¶ Retrieves the priority of the listener.
- Return
The priority of the listener.
-
virtual void
onCharacterInputEvent
(Blam::Events::CharacterInputEvent *event)¶ Called when the listener is subscribed to Character Input events, and a new CharacterInputEvent is fired.
- Parameters
-
: The event that was fired.
-
virtual void
onKeyPressEvent
(Blam::Events::KeyPressEvent *event)¶ Called when the listener is subscribed to Key Press events, and a new KeyPressEvent is fired.
- Parameters
-
: The event that was fired.
-
void