2019-07-25 21:21:03 +00:00
|
|
|
#include "../dll/dll.h"
|
|
|
|
#include "Hook_Manager.h"
|
|
|
|
|
2019-08-14 13:09:57 +00:00
|
|
|
#ifndef NO_OVERLAY
|
|
|
|
|
2019-08-27 13:38:07 +00:00
|
|
|
Hook_Manager::Hook_Manager()
|
2019-07-25 21:21:03 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
Hook_Manager::~Hook_Manager()
|
|
|
|
{
|
|
|
|
for (auto& i : _hooks)
|
|
|
|
delete i;
|
|
|
|
}
|
|
|
|
|
|
|
|
Hook_Manager& Hook_Manager::Inst()
|
|
|
|
{
|
|
|
|
static Hook_Manager hook;
|
|
|
|
return hook;
|
|
|
|
}
|
|
|
|
|
2019-08-27 13:38:07 +00:00
|
|
|
void Hook_Manager::AddHook(Base_Hook* hook)
|
2019-07-25 21:21:03 +00:00
|
|
|
{
|
2019-08-27 13:38:07 +00:00
|
|
|
_hooks.insert(hook);
|
2019-07-25 21:21:03 +00:00
|
|
|
}
|
|
|
|
|
2019-08-27 13:38:07 +00:00
|
|
|
void Hook_Manager::RemoveHook(Base_Hook* hook)
|
2019-07-25 21:21:03 +00:00
|
|
|
{
|
2019-08-27 13:38:07 +00:00
|
|
|
auto it = _hooks.find(hook);
|
|
|
|
if (it != _hooks.end())
|
2019-07-25 21:21:03 +00:00
|
|
|
{
|
2019-08-27 13:38:07 +00:00
|
|
|
delete hook;
|
|
|
|
_hooks.erase(it);
|
2019-08-16 08:36:44 +00:00
|
|
|
}
|
2019-08-14 13:09:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif//NO_OVERLAY
|