Blamite Game Engine - blam!  00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
BlamEventListener Class Reference

Class representing an Event Listener. More...

#include <events.h>

+ Inheritance diagram for BlamEventListener:

Public Member Functions

void Subscribe (BlamEventType type)
 Subscribes to an event type. More...
 
 ~BlamEventListener ()
 
std::vector< BlamEventTypeGetSubscribedEvents ()
 Retrieves the list of subscribed event types. More...
 
bool IsSubscribed (BlamEventType type)
 Determines whether or not the listener is subscribed to the specified event type. More...
 
void SetPriority (int new_priority)
 Sets the priority of the listener. More...
 
int GetPriority ()
 Retrieves the priority of the listener. More...
 
virtual void OnCharacterInputEvent (CharacterInputEvent *event)
 Called when the listener is subscribed to Character Input events, and a new CharacterInputEvent is fired. More...
 
virtual void OnConfigurationReloadEvent (ConfigurationReloadEvent *event)
 Called when the listener is subscribed to configuration reload events, and a new ConfigurationReloadEvent is fired. More...
 
virtual void OnKeyPressEvent (KeyPressEvent *event)
 Called when the listener is subscribed to Key Press events, and a new KeyPressEvent is fired. More...
 
virtual void OnMouseClickEvent (MouseClickEvent *event)
 Called when the listener is subscribed to Mouse Click events, and a new MouseClickEvent is fired. More...
 
virtual void OnMouseMoveEvent (MouseMoveEvent *event)
 Called when the listener is subscribed to Mouse Move events, and a new MouseMoveEvent is fired. More...
 
virtual void OnTickEvent (TickEvent *event)
 Called when the listener is subscribed to Key Press events, and a new TickEvent is fired. More...
 
virtual void OnNewFrameEvent (NewFrameEvent *event)
 Called when the listener is subscribed to New Frame events, and a new NewFrameEvent is fired. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~BlamEventListener()

BlamEventListener::~BlamEventListener ( )

Member Function Documentation

◆ GetPriority()

int BlamEventListener::GetPriority ( )

Retrieves the priority of the listener.

Returns
The priority of the listener.

◆ GetSubscribedEvents()

std::vector< BlamEventType > BlamEventListener::GetSubscribedEvents ( )

Retrieves the list of subscribed event types.

Returns
The list of subscribed event types.

◆ IsSubscribed()

bool BlamEventListener::IsSubscribed ( BlamEventType  type)

Determines whether or not the listener is subscribed to the specified event type.

Parameters
type- The type to check against.
Returns
Whether or not the listener is subscribed to the given type.

◆ OnCharacterInputEvent()

virtual void BlamEventListener::OnCharacterInputEvent ( CharacterInputEvent event)
inlinevirtual

Called when the listener is subscribed to Character Input events, and a new CharacterInputEvent is fired.

Parameters
event- The event that was fired.

Reimplemented in BlamRendering::RenderStack::ConsoleUI, and BlamRendering::RenderStack::DebugMenu.

◆ OnConfigurationReloadEvent()

virtual void BlamEventListener::OnConfigurationReloadEvent ( ConfigurationReloadEvent event)
inlinevirtual

Called when the listener is subscribed to configuration reload events, and a new ConfigurationReloadEvent is fired.

Parameters
event- The event that was fired.

◆ OnKeyPressEvent()

virtual void BlamEventListener::OnKeyPressEvent ( KeyPressEvent event)
inlinevirtual

Called when the listener is subscribed to Key Press events, and a new KeyPressEvent is fired.

Parameters
event- The event that was fired.

Reimplemented in BlamRendering::RenderStack::DebugMenu, BlamRendering::RenderStack::ConsoleUI, and BlamDirector.

◆ OnMouseClickEvent()

virtual void BlamEventListener::OnMouseClickEvent ( MouseClickEvent event)
inlinevirtual

Called when the listener is subscribed to Mouse Click events, and a new MouseClickEvent is fired.

Parameters
event- The event that was fired.

Reimplemented in BlamDirector.

◆ OnMouseMoveEvent()

virtual void BlamEventListener::OnMouseMoveEvent ( MouseMoveEvent event)
inlinevirtual

Called when the listener is subscribed to Mouse Move events, and a new MouseMoveEvent is fired.

Parameters
event- The event that was fired.

Reimplemented in BlamDirector.

◆ OnNewFrameEvent()

virtual void BlamEventListener::OnNewFrameEvent ( NewFrameEvent event)
inlinevirtual

Called when the listener is subscribed to New Frame events, and a new NewFrameEvent is fired.

Parameters
event- The event that was fired.

Reimplemented in BlamDirector.

◆ OnTickEvent()

virtual void BlamEventListener::OnTickEvent ( TickEvent event)
inlinevirtual

Called when the listener is subscribed to Key Press events, and a new TickEvent is fired.

Parameters
event- The event that was fired.

Reimplemented in BlamRendering::RenderStack::DebugMenuItem, BlamRendering::RenderStack::TickCounter, BlamDirector, and BlamRendering::RenderStack::ConsoleMessage.

◆ SetPriority()

void BlamEventListener::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.

◆ Subscribe()

void BlamEventListener::Subscribe ( BlamEventType  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.

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