Actor::IsType
This commit is contained in:
@@ -269,6 +269,19 @@ void Actor::LoadFromNode( const CString& sDir, const XNode* pNode )
|
|||||||
PlayCommand( "Init" );
|
PlayCommand( "Init" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Like RTTI: return true if this actor is an sType (or derived from sType).
|
||||||
|
* This uses the Lua binding check, so only works on bound types. */
|
||||||
|
bool Actor::IsType( const CString &sType )
|
||||||
|
{
|
||||||
|
Lua *L = LUA->Get();
|
||||||
|
this->PushSelf( L );
|
||||||
|
bool bRet = CheckLuaObjectType( L, -1, sType, false );
|
||||||
|
lua_pop( L, 1 );
|
||||||
|
LUA->Release( L );
|
||||||
|
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
|
||||||
void Actor::Draw()
|
void Actor::Draw()
|
||||||
{
|
{
|
||||||
if( !m_bVisible )
|
if( !m_bVisible )
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public:
|
|||||||
void UnsubcribeAndClearCommands();
|
void UnsubcribeAndClearCommands();
|
||||||
virtual void Reset();
|
virtual void Reset();
|
||||||
virtual void LoadFromNode( const CString& sDir, const XNode* pNode );
|
virtual void LoadFromNode( const CString& sDir, const XNode* pNode );
|
||||||
|
bool IsType( const CString &sType );
|
||||||
|
|
||||||
static void SetBGMTime( float fTime, float fBeat );
|
static void SetBGMTime( float fTime, float fBeat );
|
||||||
static void SetBGMLight( int iLightNumber, float fCabinetLights );
|
static void SetBGMLight( int iLightNumber, float fCabinetLights );
|
||||||
|
|||||||
Reference in New Issue
Block a user