mirror of
https://github.com/Andreabont/CppExperiments.git
synced 2024-09-19 15:23:05 +00:00
14 lines
376 B
C++
14 lines
376 B
C++
|
#include "EventManager.h"
|
||
|
|
||
|
void EventManager::eventRegister(std::string eventName, std::function< void(EventInfo) > callBack) {
|
||
|
this->callBackList[eventName].push_back(callBack);
|
||
|
}
|
||
|
|
||
|
void EventManager::eventDispatch(std::string eventName){
|
||
|
EventInfo info;
|
||
|
info.eventName = eventName;
|
||
|
for(auto call : this->callBackList[eventName]) {
|
||
|
call(info);
|
||
|
}
|
||
|
}
|