summaryrefslogtreecommitdiffstats
path: root/source/squirrelbindings/SquirrelObject.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/SquirrelObject.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/SquirrelObject.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/squirrelbindings/SquirrelObject.h b/source/squirrelbindings/SquirrelObject.h
new file mode 100644
index 000000000..1ac6fa105
--- /dev/null
+++ b/source/squirrelbindings/SquirrelObject.h
@@ -0,0 +1,24 @@
+#pragma once
+#include <sqrat.h>
+
+class SquirrelObject
+{
+public:
+ SquirrelObject(Sqrat::Object a_Obj)
+ {
+ m_SquirrelObject = a_Obj;
+ }
+
+ Sqrat::Function GetFunction(const char *methodName)
+ {
+ if(m_SquirrelObject.IsNull())
+ return Sqrat::Function();
+
+ Sqrat::Function method(m_SquirrelObject, methodName);
+ return method;
+ }
+
+protected:
+ Sqrat::Object m_SquirrelObject;
+
+}; \ No newline at end of file