Actor::IsType

This commit is contained in:
Glenn Maynard
2005-10-10 21:52:04 +00:00
parent a69244f41f
commit 0f17b0f9c2
2 changed files with 14 additions and 0 deletions
+13
View File
@@ -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 )
+1
View File
@@ -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 );