1
0
cuberite-2a/source/squirrelbindings/SquirrelObject.h
madmaxoft@gmail.com f7ef93611c Removed the SquirrelVM.
It has been crashing the server. http://forum.mc-server.org/showthread.php?tid=610

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1024 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-08 19:09:35 +00:00

56 lines
609 B
C++

#pragma once
#ifdef USE_SQUIRREL
#include <sqrat.h>
class SquirrelObject
{
public:
SquirrelObject(Sqrat::Object a_Obj)
{
m_SquirrelObject = a_Obj;
}
Sqrat::Function GetFunction(const char *a_MethodName)
{
if(m_SquirrelObject.IsNull())
return Sqrat::Function();
Sqrat::Function method(m_SquirrelObject, a_MethodName);
return method;
}
bool HasFunction(const char *a_MethodName)
{
return !this->GetFunction(a_MethodName).IsNull();
}
protected:
Sqrat::Object m_SquirrelObject;
};
#endif // USE_SQUIRREL