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:
@@ -149,11 +149,13 @@ const RString& MessageIDToString( MessageID m );
|
||||
struct Message
|
||||
{
|
||||
explicit Message( const RString &s );
|
||||
Message( const RString &s, const LuaReference ¶ms );
|
||||
~Message();
|
||||
RString GetName() const { return m_sName; }
|
||||
|
||||
void PushParamTable( lua_State *L );
|
||||
const LuaReference &GetParamTable() const;
|
||||
void SetParamTable( const LuaReference ¶ms );
|
||||
|
||||
void GetParamFromStack( lua_State *L, const RString &sName ) const;
|
||||
void SetParamFromStack( lua_State *L, const RString &sName );
|
||||
|
||||
Reference in New Issue
Block a user