2013-08-22 20:55:33 +02:00
|
|
|
#ifndef _INCLUDE_LISTENERS_H_
|
|
|
|
#define _INCLUDE_LISTENERS_H_
|
2013-08-19 17:07:25 +02:00
|
|
|
|
|
|
|
#include "extension.h"
|
|
|
|
#include "vhook.h"
|
2016-12-12 06:02:10 +01:00
|
|
|
#include <am-vector.h>
|
2013-08-19 17:07:25 +02:00
|
|
|
|
2013-08-22 20:55:33 +02:00
|
|
|
enum ListenType
|
|
|
|
{
|
|
|
|
ListenType_Created,
|
|
|
|
ListenType_Deleted
|
|
|
|
};
|
|
|
|
|
2013-08-19 17:07:25 +02:00
|
|
|
class DHooksEntityListener : public ISMEntityListener
|
|
|
|
{
|
|
|
|
public:
|
2013-08-22 04:18:52 +02:00
|
|
|
virtual void OnEntityCreated(CBaseEntity *pEntity, const char *classname);
|
|
|
|
virtual void OnEntityDestroyed(CBaseEntity *pEntity);
|
2014-08-19 19:14:48 +02:00
|
|
|
void CleanupListeners(IPluginContext *func = NULL);
|
2013-08-22 20:55:33 +02:00
|
|
|
bool AddPluginEntityListener(ListenType type, IPluginFunction *callback);
|
|
|
|
bool RemovePluginEntityListener(ListenType type, IPluginFunction *callback);
|
2013-08-19 17:07:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct EntityListener
|
|
|
|
{
|
|
|
|
ListenType type;
|
|
|
|
IPluginFunction *callback;
|
|
|
|
};
|
|
|
|
|
2016-08-27 16:20:38 +02:00
|
|
|
extern ke::Vector<DHooksManager *> g_pHooks;
|
2013-08-19 17:07:25 +02:00
|
|
|
#endif
|