Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
49
Src/Wasabi/api/script/objects/c_script/scripthook.h
Normal file
49
Src/Wasabi/api/script/objects/c_script/scripthook.h
Normal file
|
@ -0,0 +1,49 @@
|
|||
#ifndef __SCRIPTHOOK_H
|
||||
#define __SCRIPTHOOK_H
|
||||
|
||||
#include <api/script/vcputypes.h>
|
||||
#include <bfc/dispatch.h>
|
||||
#include <bfc/ptrlist.h>
|
||||
|
||||
|
||||
class ScriptObject;
|
||||
class ScriptObjectController;
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------
|
||||
|
||||
class ScriptHook : public Dispatchable {
|
||||
protected:
|
||||
ScriptHook() {};
|
||||
|
||||
public:
|
||||
int eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams);
|
||||
|
||||
enum {
|
||||
EVENTCALLBACK = 100,
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
inline int ScriptHook::eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams) {
|
||||
return _call(EVENTCALLBACK, 0, object, dlfid, params, nparams);
|
||||
}
|
||||
|
||||
class ScriptHookI : public ScriptHook {
|
||||
|
||||
public:
|
||||
|
||||
ScriptHookI();
|
||||
virtual ~ScriptHookI();
|
||||
|
||||
virtual int eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams)=0;
|
||||
|
||||
void addMonitorObject(ScriptObject *o, const GUID *hookedclass=NULL); // NULL = all classes of object o
|
||||
void addMonitorClass(ScriptObject *o);
|
||||
|
||||
protected:
|
||||
RECVS_DISPATCH;
|
||||
|
||||
PtrList<ScriptObjectController> controllers;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue