2012-11-08 14:09:35 -05:00
|
|
|
|
2012-07-08 17:01:08 -04:00
|
|
|
#pragma once
|
2012-11-08 14:09:35 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef USE_SQUIRREL
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-08 17:01:08 -04:00
|
|
|
#include <sqrat.h>
|
|
|
|
|
2012-11-08 14:09:35 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-08 17:01:08 -04:00
|
|
|
class SquirrelObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SquirrelObject(Sqrat::Object a_Obj)
|
|
|
|
{
|
|
|
|
m_SquirrelObject = a_Obj;
|
|
|
|
}
|
|
|
|
|
2012-07-10 12:46:15 -04:00
|
|
|
Sqrat::Function GetFunction(const char *a_MethodName)
|
2012-07-08 17:01:08 -04:00
|
|
|
{
|
|
|
|
if(m_SquirrelObject.IsNull())
|
|
|
|
return Sqrat::Function();
|
|
|
|
|
2012-07-10 12:46:15 -04:00
|
|
|
Sqrat::Function method(m_SquirrelObject, a_MethodName);
|
2012-07-08 17:01:08 -04:00
|
|
|
return method;
|
|
|
|
}
|
|
|
|
|
2012-07-10 12:46:15 -04:00
|
|
|
bool HasFunction(const char *a_MethodName)
|
|
|
|
{
|
|
|
|
return !this->GetFunction(a_MethodName).IsNull();
|
|
|
|
}
|
|
|
|
|
2012-07-08 17:01:08 -04:00
|
|
|
protected:
|
|
|
|
Sqrat::Object m_SquirrelObject;
|
|
|
|
|
2012-11-08 14:09:35 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // USE_SQUIRREL
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|