sm-ext-dhooks2/listeners.h

33 lines
754 B
C
Raw Permalink Normal View History

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"
#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:
virtual void OnEntityCreated(CBaseEntity *pEntity, const char *classname);
virtual void OnEntityDestroyed(CBaseEntity *pEntity);
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;
};
extern ke::Vector<DHooksManager *> g_pHooks;
2013-08-19 17:07:25 +02:00
#endif