sm-ext-dhooks2/listeners.h

33 lines
755 B
C
Raw 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"
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);
2013-08-19 17:07:25 +02:00
void CleanupListeners(IPluginContext *func);
virtual void LevelShutdown();
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 CUtlVector<DHooksManager *> g_pHooks;
#endif