|
|
@@ -3,7 +3,7 @@
|
|
|
* Company: Lynar Studios
|
|
|
* E-Mail: webmaster@lynarstudios.com
|
|
|
* Created: 2024-05-16
|
|
|
-* Changed: 2024-05-30
|
|
|
+* Changed: 2025-12-21
|
|
|
*
|
|
|
* */
|
|
|
|
|
|
@@ -34,7 +34,7 @@ listener_id EventManager::getNextProvisionId() const
|
|
|
return this->provisionId;
|
|
|
}
|
|
|
|
|
|
-bool EventManager::holdsListenerForEvent(listener_id _id, const Event &_event)
|
|
|
+bool EventManager::holdsListenerForEvent(const listener_id _id, const Event &_event)
|
|
|
{
|
|
|
bool holdsListener{};
|
|
|
|
|
|
@@ -73,13 +73,13 @@ void EventManager::invoke(const Event &_event, const EventParameter &_parameter)
|
|
|
}
|
|
|
|
|
|
const auto &listeners = this->inventory[_event.getClassName()];
|
|
|
- EventManager::_giveListenersParameter(listeners, _parameter);
|
|
|
- EventManager::_notifyListeners(listeners);
|
|
|
+ _giveListenersParameter(listeners, _parameter);
|
|
|
+ _notifyListeners(listeners);
|
|
|
}
|
|
|
|
|
|
listener_id EventManager::requestListenerId()
|
|
|
{
|
|
|
- listener_id providedId = this->provisionId;
|
|
|
+ const listener_id providedId = this->provisionId;
|
|
|
++this->provisionId;
|
|
|
|
|
|
return providedId;
|
|
|
@@ -92,7 +92,7 @@ void EventManager::subscribeListenerForEvent(shared_ptr<EventListener> _listener
|
|
|
this->inventory[_event.getClassName()] = {};
|
|
|
}
|
|
|
|
|
|
- auto inventoryEntry = make_pair<shared_ptr<EventListener>, event_action>(::move(_listener), ::move(_action));
|
|
|
+ const auto inventoryEntry = make_pair<shared_ptr<EventListener>, event_action>(::move(_listener), ::move(_action));
|
|
|
this->inventory[_event.getClassName()].push_back(inventoryEntry);
|
|
|
}
|
|
|
|
|
|
@@ -100,7 +100,7 @@ void EventManager::unsubscribeListenerForEvent(const shared_ptr<EventListener> &
|
|
|
{
|
|
|
if (this->_observesEvent(_event))
|
|
|
{
|
|
|
- for (auto iterator = this->inventory[_event.getClassName()].begin(); iterator != this->inventory[_event.getClassName()].end(); iterator++)
|
|
|
+ for (auto iterator = this->inventory[_event.getClassName()].begin(); iterator != this->inventory[_event.getClassName()].end(); ++iterator)
|
|
|
{
|
|
|
if (iterator->first->getId() == _listener->getId())
|
|
|
{
|