1
0
cuberite-2a/source/squirrelbindings/SquirrelObject.h
lapayo94@gmail.com 273ddcbfff Fixed some bugs within the squirrel plugin system.
Implemented feature request www.mc-server.org/support/index.php?do=details&task_id=53

git-svn-id: http://mc-server.googlecode.com/svn/trunk@655 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-10 16:46:15 +00:00

29 lines
513 B
C++

#pragma once
#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;
};