summaryrefslogtreecommitdiffstats
path: root/source/squirrelbindings/cSquirrelBaseClass.h
diff options
context:
space:
mode:
authorlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-07-08 23:01:08 +0200
committerlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-07-08 23:01:08 +0200
commit083228a10dffcaa77b1d0035c29013c6802befd4 (patch)
tree4d8ba1ce8501f044d10135e836e6f956f1b99fa4 /source/squirrelbindings/cSquirrelBaseClass.h
parentAdded a lilypad finisher (diff)
downloadcuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar.gz
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar.bz2
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar.lz
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar.xz
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar.zst
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.zip
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