Messages and commands are nearly identical: they both have a name,

they can both have parameters stashed in a table, and they both play
stuff out of the actor command list.  Merge them; now the only
difference between playing and broadcasting a command is that playing
plays recursively on a tree and broadcasting sends to all subscribers.

The distinction between "messages" and "commands" is cosmetic now;
everything is a message.  The only thing special about commands intended
to be received as a broadcast is the "Message" suffix, which subscribes it.
This commit is contained in:
Glenn Maynard
2007-02-03 06:17:02 +00:00
parent 8dbb54a1c6
commit 9bc27fb390
13 changed files with 49 additions and 33 deletions
+3 -3
View File
@@ -66,12 +66,12 @@ bool Transition::EarlyAbortDraw() const
/* Our parent might send us OnCommand. We do that ourself, because
* we sometimes want to know GetLengthSeconds before StartTransitioning.
* Make sure we don't process OnCommand twice. */
void Transition::PlayCommand( const RString &sCommandName, const LuaReference *pParamTable )
void Transition::HandleMessage( const Message &msg )
{
if( sCommandName == "On" )
if( msg.GetName() == "On" )
return;
ActorFrame::PlayCommand( sCommandName, pParamTable );
ActorFrame::HandleMessage( msg );
}
void Transition::StartTransitioning( ScreenMessage send_when_done )