Files
cuberite-2a/source/squirrelbindings/SquirrelObject.h
T

29 lines
513 B
C++
Raw Normal View History

2012-07-08 21:01:08 +00:00
#pragma once
#include <sqrat.h>
class SquirrelObject
{
public:
SquirrelObject(Sqrat::Object a_Obj)
{
m_SquirrelObject = a_Obj;
}
Sqrat::Function GetFunction(const char *a_MethodName)
2012-07-08 21:01:08 +00:00
{
if(m_SquirrelObject.IsNull())
return Sqrat::Function();
Sqrat::Function method(m_SquirrelObject, a_MethodName);
2012-07-08 21:01:08 +00:00
return method;
}
bool HasFunction(const char *a_MethodName)
{
return !this->GetFunction(a_MethodName).IsNull();
}
2012-07-08 21:01:08 +00:00
protected:
Sqrat::Object m_SquirrelObject;
};