summaryrefslogtreecommitdiffstats
path: root/source/squirrelbindings/cSquirrelBaseClass.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/squirrelbindings/cSquirrelBaseClass.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/source/squirrelbindings/cSquirrelBaseClass.h b/source/squirrelbindings/cSquirrelBaseClass.h
new file mode 100644
index 000000000..e06301555
--- /dev/null
+++ b/source/squirrelbindings/cSquirrelBaseClass.h
@@ -0,0 +1,29 @@
+#pragma once
+#include "SquirrelBindings.h"
+#include "../cPlugin_Squirrel.h"
+#include "../cPluginManager.h"
+#include "cRoot.h"
+
+//The baseclass for squirrel plugins
+class cSquirrelBaseClass
+{
+public:
+ cSquirrelBaseClass()
+ : m_Instance(0)
+ {
+ }
+
+ void setInstance(cPlugin_Squirrel *a_Instance)
+ {
+ m_Instance = a_Instance;
+ }
+
+ void AddHook(short a_Hook)
+ {
+ if(m_Instance)
+ cRoot::Get()->GetPluginManager()->AddHook(m_Instance, (cPluginManager::PluginHook) a_Hook);
+ }
+
+protected:
+ cPlugin_Squirrel *m_Instance;
+}; \ No newline at end of file