move message helper stuff out of Actor into a new base class so that it can be used w/o deriving from Actor

This commit is contained in:
Chris Danford
2006-02-06 01:26:52 +00:00
parent b03b2dc768
commit a05d1e8265
4 changed files with 68 additions and 49 deletions
+24
View File
@@ -193,6 +193,30 @@ void IMessageSubscriber::ProcessMessages( float fDeltaTime )
g_Mutex.Unlock();
}
MessageSubscriber::MessageSubscriber( const MessageSubscriber &cpy )
{
m_vsSubscribedTo = cpy.m_vsSubscribedTo;
}
void MessageSubscriber::SubscribeToMessage( const RString &sMessageName )
{
MESSAGEMAN->Subscribe( this, sMessageName );
m_vsSubscribedTo.push_back( sMessageName );
}
void MessageSubscriber::SubscribeToMessage( Message message )
{
MESSAGEMAN->Subscribe( this, message );
m_vsSubscribedTo.push_back( MessageToString(message) );
}
void MessageSubscriber::UnsubscribeAll()
{
FOREACH_CONST( RString, m_vsSubscribedTo, s )
MESSAGEMAN->Unsubscribe( this, *s );
m_vsSubscribedTo.clear();
}
// lua start
#include "LuaBinding.h"