273ddcbfff
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
29 lines
513 B
C++
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;
|
|
|
|
}; |