Blamite Game Engine - blam!  00272.10.26.20.0001.blamite
The core library for the Blamite Game Engine.
events.cpp File Reference
#include "events.h"
#include <algorithm>
#include <Strings/components/utils/converters/converters.h>
#include "components/diagnostics/logger/logger.h"

Functions

void notify_listener (Event *event, EventListener *listener)
 Notifies the specified listener about an event. More...
 
bool compare_listener_priority (EventListener *first, EventListener *second)
 Compares listener priority. More...
 

Variables

std::vector< Blam::Events::EventListener * > listeners
 List of registered event listeners. More...
 

Function Documentation

◆ compare_listener_priority()

bool compare_listener_priority ( EventListener first,
EventListener second 
)

Compares listener priority.

Used to sort the list after priority modifications.

Parameters
first- The first listener to check.
second- The second listener to check.
Returns
Whether or not the priority of the first listener is less than the priority of the second listener.

◆ notify_listener()

void notify_listener ( Event event,
EventListener listener 
)

Notifies the specified listener about an event.

Each event type must be added to this in order for the appropriate function(s) to be called.

Parameters
event- Pointer to the event.
listener- Pointer to the listener.

Variable Documentation

◆ listeners

std::vector<Blam::Events::EventListener*> listeners

List of registered event listeners.