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