Elaztek Developer Hub
Blamite Game Engine - Strings  00390.07.02.23.1947.blamite
A library containing general purpose utilities and classes for use in multiple projects.
BlamEventListener Class Reference

Class representing an Event Listener. More...

#include <events.h>

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 Tick 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...
 
virtual void OnLogMessageEvent (LogMessageEvent *event)
 Called when the listener is subscribed to Log Message events, and a new LogMessageEvent is fired. More...
 
virtual void OnEditorTickEvent (EditorTickEvent *event)
 Called when the listener is subscribed to Editor Tick events, and a new EditorTickEvent is fired. More...
 
virtual void OnEditorThemeChangeEvent (EditorThemeChangeEvent *event)
 Called when the listener is subscribed to Editor Theme Change events, and a new EditorThemeChangeEvent is fired. More...
 

Public Attributes

std::string name = ""
 The name of the listener. Used for debugging purposes. 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.

Todo:
Fix event firing on deleted listener bug: possible hacky fix would be to have a pre-defined value at the start/end of all listener objects, and skipping any listener where those values were changed.

Constructor & Destructor Documentation

◆ ~BlamEventListener()

BlamEventListener::~BlamEventListener ( )
+ Here is the call graph for this function:

Member Function Documentation

◆ GetPriority()

int BlamEventListener::GetPriority ( )

Retrieves the priority of the listener.

Returns
The priority of the listener.
+ Here is the caller graph for this function:

◆ 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.
+ Here is the caller graph for this function:

◆ 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.
+ Here is the caller graph for this function:

◆ 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.
+ Here is the caller graph for this function:

◆ OnEditorThemeChangeEvent()

virtual void BlamEventListener::OnEditorThemeChangeEvent ( EditorThemeChangeEvent event)
inlinevirtual

Called when the listener is subscribed to Editor Theme Change events, and a new EditorThemeChangeEvent is fired.

Parameters
event- The event that was fired.
+ Here is the caller graph for this function:

◆ OnEditorTickEvent()

virtual void BlamEventListener::OnEditorTickEvent ( EditorTickEvent event)
inlinevirtual

Called when the listener is subscribed to Editor Tick events, and a new EditorTickEvent is fired.

Parameters
event- The event that was fired.
+ Here is the caller graph for this function:

◆ 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.
+ Here is the caller graph for this function:

◆ OnLogMessageEvent()

virtual void BlamEventListener::OnLogMessageEvent ( LogMessageEvent event)
inlinevirtual

Called when the listener is subscribed to Log Message events, and a new LogMessageEvent is fired.

Parameters
event- The event that was fired.
+ Here is the caller graph for this function:

◆ 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.
+ Here is the caller graph for this function:

◆ 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.
+ Here is the caller graph for this function:

◆ 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.
+ Here is the caller graph for this function:

◆ OnTickEvent()

virtual void BlamEventListener::OnTickEvent ( TickEvent event)
inlinevirtual

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

Parameters
event- The event that was fired.
+ Here is the caller graph for this function:

◆ 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.
+ Here is the call graph for this function:

◆ 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.

Member Data Documentation

◆ name

std::string BlamEventListener::name = ""

The name of the listener. Used for debugging purposes.


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