Mercury Messaging
Documentation for the Mercury Messaging Framework
MercuryMessaging.MmRelaySwitchNode Class Reference

an MmRelayNode with an FSM to allow for limited MmResponder selection in the MmRelayNode's MmRoutingTable. More...

Inheritance diagram for MercuryMessaging.MmRelaySwitchNode:
MercuryMessaging.MmRelayNode MercuryMessaging.MmResponder MercuryMessaging.IMmNode MercuryMessaging.IMmResponder

Public Member Functions

override void Awake ()
 Converts the standard MmRoutingTable into a FSM. Calls MmOnAwakeComplete through MmResponder Awake. More...
 
override void Start ()
 Calls MmOnStartComplete through MmResponder Start. More...
 
virtual void JumpTo (string newState)
 FSM control method: Jump to State, using MmRoutingTableItem name. More...
 
virtual void JumpTo (MmRelayNode newState)
 FSM control method: Jump to State, using MmRoutingTableItem Responder reference. More...
 
- Public Member Functions inherited from MercuryMessaging.MmRelayNode
 MmRelayNode ()
 Creates an empty MmResponder list on construction. More...
 
virtual MmRoutingTableItem MmAddToRoutingTable (MmResponder mmResponder, MmLevelFilter level)
 Add an MmResponder to the MmRoutingTable, with level designation. More...
 
virtual MmRoutingTableItem MmAddToRoutingTable (MmResponder mmResponder, string newName)
 Add an MmResponder to the MmRoutingTable, with level designation. More...
 
void MmRefreshResponders ()
 Grab all MmResponders attached to the same GameObject. Does not grab any other MmRelayNodes attached to the same GameObject. More...
 
void RefreshParents ()
 Iterates through RoutingTable list and assigns this MmRelayNode as a parent to child MmResponders. More...
 
virtual void MmAddNodeToList (GameObject go)
 Given a GameObject, extract an MmRelayNode if present and add it to this MmRelayNode's Responder list. More...
 
virtual void AddParent (MmRelayNode parent)
 Given an MmRelayNode, add it as parent to this instance's MmRoutingTable. More...
 
override void MmInvoke (MmMessageType msgType, MmMessage message)
 Invoke an MmMethod. More...
 
virtual void MmInvoke (MmMethod mmMethod, MmMetadataBlock metadataBlock=null)
 Invoke an MmMethod with no parameter. More...
 
virtual void MmInvoke (MmMethod mmMethod, bool param, MmMetadataBlock metadataBlock=null)
 Invoke an MmMethod with parameter: bool. More...
 
virtual void MmInvoke (MmMethod mmMethod, int param, MmMetadataBlock metadataBlock=null)
 Invoke an MmMethod with parameter: int. More...
 
virtual void MmInvoke (MmMethod mmMethod, float param, MmMetadataBlock metadataBlock=null)
 Invoke an MmMethod with parameter: float. More...
 
virtual void MmInvoke (MmMethod mmMethod, Vector3 param, MmMetadataBlock metadataBlock=null)
 Invoke an MmMethod with parameter: Vector3.
More...
 
virtual void MmInvoke (MmMethod mmMethod, Vector4 param, MmMetadataBlock metadataBlock=null)
 Invoke an MmMethod with parameter: Vector4.
More...
 
virtual void MmInvoke (MmMethod mmMethod, string param, MmMetadataBlock metadataBlock=null)
 Invoke an MmMethod with parameter: string. More...
 
virtual void MmInvoke (MmMethod mmMethod, byte[] param, MmMetadataBlock metadataBlock=null)
 Invoke an MmMethod with parameter: byte array.
More...
 
virtual void MmInvoke (MmMethod mmMethod, MmTransform param, MmMetadataBlock metadataBlock=null)
 Invoke an MmMethod with parameter: MmTransform. More...
 
virtual void MmInvoke (MmMethod mmMethod, List< MmTransform > param, MmMetadataBlock metadataBlock=null)
 Invoke an MmMethod with parameter: List<MmTransform>. More...
 
virtual void MmInvoke (MmMethod mmMethod, IMmSerializable param, MmMetadataBlock metadataBlock=null)
 Invoke an MmMethod with parameter: IMmSerializable. More...
 
override MmRelayNode GetRelayNode ()
 Implementation of IMmResponder's GetRelayNode, which returns this. More...
 
- Public Member Functions inherited from MercuryMessaging.MmResponder
virtual void Update ()
 Base Update of MmResponder Derived classes should always override. More...
 
virtual void MmOnAwakeComplete ()
 Post Awake callback used between objects implementing this interface. This allows for initialization steps that must occur before one instance's Awake and its Start. More...
 
virtual void MmOnStartComplete ()
 Post Start callback used between objects implementing this interface This allows for initialization steps that must occur before one instance's Start and its first Update. More...
 
virtual void MmRegisterAwakeCompleteCallback (IMmCallback callback)
 It is possible that certain handles are not going to be in-place when registration of the OnAwakeComplete callback is invoked. The is especially true in scenarios where MmRelayNodes are networked. This allows for a deferred registration, eliminating most instances where the Awake callback invocations fail. More...
 
virtual void MmRegisterStartCompleteCallback (IMmCallback callback)
 It is possible that certain handles are not going to be in-place when registration of the OnStartComplete callback is invoked. The is especially true in scenarios where MmRelayNodes are networked. This allows for a deferred registration, eliminating most instances where the Start callback invocations fail. More...
 

Public Attributes

FiniteStateMachine< MmRoutingTableItemRespondersFSM
 The Finite state machine of the MmRelayNode's RoutingTable. More...
 
- Public Attributes inherited from MercuryMessaging.MmRelayNode
bool FlipNetworkFlagOnSend = false
 Does the node convert the message to a local message from networked on post send in order to guarantee that it does not send it over the network deeper in the hierarchy. More...
 
bool AllowNetworkPropagationLocally = false
 Allows Node to pass a Network-only message into the hierarchy More...
 
bool ReparentClonedRespondersToSelf = true
 Indicates whether cloned MmResponders should be added as children to the MmRelayNode's GameObject. More...
 
bool Initialized
 Indicates whether the MmRelayNode is ready for use This gets set either in Awake or on the first MmInvoke. More...
 
bool AutoGrabAttachedResponders = true
 There may be an issue where a message is received before self responders have been added to the list. In order to resolve that issue, we allow the node to automatically grab all responders. The consequence here is that you cannot have responders on a node that do not automatically get added to the list. More...
 
MmRoutingTable RoutingTable
 List of associated Mercury Responders. Each Mercury Routing Table Item contains: MmResponder, Name, Level (Self, Child, Parent), Cloneable (Indicates whether the Responder should be cloned when MmRelayNode is awoken), MmTag (Multi-tag filter supported by Mercury XM). More...
 

Protected Member Functions

override bool SelectedCheck (MmSelectedFilter selectedFilter, IMmResponder responder)
 Overrides MmRelayNode's Selected check to handle the FSM's current state. More...
 
- Protected Member Functions inherited from MercuryMessaging.MmRelayNode
void InitializeNode ()
 
virtual MmLevelFilter LevelFilterAdjust (ref MmMessage message, MmLevelFilter direction)
 If the level filter is designated 'Child', then it is recorded locally, but converted to a 'Child+Self' for use by the RoutingTable (which need to pass the message on to all children, but still need to be able to execute the message on their own responders, otherwise, it just goes to the terminal points of the graph without ever executing). More...
 
virtual MmActiveFilter ActiveFilterAdjust (ref MmMessage message)
 Allows modification of active filter in message as it gets passed between MmRelayNodes. More...
 
virtual MmSelectedFilter SelectedFilterAdjust (ref MmMessage message)
 Allows modification of selected filter in message as it gets passed between MmRelayNodes. More...
 
virtual MmNetworkFilter NetworkFilterAdjust (ref MmMessage message)
 Allows modification of network filter in message as it gets passed between MmRelayNodes. More...
 
virtual bool ResponderCheck (MmLevelFilter levelFilter, MmActiveFilter activeFilter, MmSelectedFilter selectedFilter, MmNetworkFilter networkFilter, MmRoutingTableItem mmRoutingTableItem, MmMessage message)
 This method determines if a particular MmResponder should receive a message via MmInvoke. This performs 4 checks: Tag Check, Level Check, Active Check, & Selected Check. More...
 
virtual bool TagCheck (MmRoutingTableItem mmRoutingTableItem, MmMessage message)
 Determine if MmResponder passes MmRelayNode tag filter check using value embedded in MmMessage. More...
 
virtual bool LevelCheck (MmLevelFilter levelFilter, IMmResponder responder, MmLevelFilter responderLevel)
 Determine if MmResponder passes MmRelayNode level filter check using value embedded in MmMessage. More...
 
virtual bool ActiveCheck (MmActiveFilter activeFilter, IMmResponder responder)
 Determine if MmResponder passes MmRelayNode active filter check using value embedded in MmMessage. More...
 
virtual bool NetworkCheck (MmRoutingTableItem mmRoutingTableItem, MmMessage message)
 Checks if a responder should recieve a message based on the network flag in a control block. Network messages can go to other nodes, but not to self responders. More...
 

Properties

MmRelayNode Current [get]
 FSM Current State More...
 
string CurrentName [get]
 MmRoutingTable name of FSM current state. More...
 
StateEvents this[string state] [get, set]
 Accessor for particular state by name. More...
 
- Properties inherited from MercuryMessaging.MmRelayNode
IMmNetworkResponder MmNetworkResponder [get]
 Associated MmNetworkResponder. If an MmNetworkResponder is attached o the same GameObject, it will automatically attach to this MmRelayNode. This turns all MmMethod invocations into networked MmMethod invocations, with no additional effort. More...
 
string Name [get]
 MmRelayNode name: returns GameObject name. More...
 
- Properties inherited from MercuryMessaging.MmResponder
GameObject MmGameObject [get]
 Handle to an instance's GameObject. More...
 
MmTag Tag [get, set]
 MmTags allow you to specify filters for execution in Mercury XM graphs. More...
 
bool TagCheckEnabled [get, set]
 Determines whether tag checking is enabled for this IMmResponder More...
 
- Properties inherited from MercuryMessaging.IMmResponder
MmTag Tag [get, set]
 MmTags allow you to specify filters for execution in MercuryMessaging Hierarchies. MmTag More...
 
GameObject MmGameObject [get]
 Handle to an instance's GameObject. More...
 
bool TagCheckEnabled [get, set]
 Determines whether tag checking is enabled for this IMmResponder More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MercuryMessaging.MmRelayNode
static MmRelayNode GetRelayNode (IMmResponder iMmResponder)
 Given an MmResponder, extract an MmRelayNode from it's GameObject, if one is present. More...
 
static MmRelayNode GetRelayNode (GameObject go)
 Given a GameObject, extract the first MmRelayNode, if any are present. More...
 
- Protected Attributes inherited from MercuryMessaging.MmRelayNode
Queue< MmRoutingTableItemMmRespondersToAdd
 Queue of MmResponders to add once list is no longer in use by an MmInvoke More...
 
Queue< KeyValuePair< MmMessageType, MmMessage > > SerialExecutionQueue
 Queue of Memessages to route if serialExecution is enabled and messages are received while another message is being executed. More...
 

Detailed Description

an MmRelayNode with an FSM to allow for limited MmResponder selection in the MmRelayNode's MmRoutingTable.

Member Function Documentation

◆ Awake()

override void MercuryMessaging.MmRelaySwitchNode.Awake ( )
virtual

Converts the standard MmRoutingTable into a FSM. Calls MmOnAwakeComplete through MmResponder Awake.

Reimplemented from MercuryMessaging.MmRelayNode.

◆ JumpTo() [1/2]

virtual void MercuryMessaging.MmRelaySwitchNode.JumpTo ( string  newState)
virtual

FSM control method: Jump to State, using MmRoutingTableItem name.

Parameters
newStateName of target state.

◆ JumpTo() [2/2]

virtual void MercuryMessaging.MmRelaySwitchNode.JumpTo ( MmRelayNode  newState)
virtual

FSM control method: Jump to State, using MmRoutingTableItem Responder reference.

Parameters
newStateName of target state.

◆ SelectedCheck()

override bool MercuryMessaging.MmRelaySwitchNode.SelectedCheck ( MmSelectedFilter  selectedFilter,
IMmResponder  responder 
)
protectedvirtual

Overrides MmRelayNode's Selected check to handle the FSM's current state.

Parameters
selectedFilterSelectedCheck
responderObserved MmResponder.
Returns

Reimplemented from MercuryMessaging.MmRelayNode.

◆ Start()

override void MercuryMessaging.MmRelaySwitchNode.Start ( )
virtual

Calls MmOnStartComplete through MmResponder Start.

Reimplemented from MercuryMessaging.MmRelayNode.

Member Data Documentation

◆ RespondersFSM

FiniteStateMachine<MmRoutingTableItem> MercuryMessaging.MmRelaySwitchNode.RespondersFSM

The Finite state machine of the MmRelayNode's RoutingTable.

Property Documentation

◆ Current

MmRelayNode MercuryMessaging.MmRelaySwitchNode.Current
get

FSM Current State

◆ CurrentName

string MercuryMessaging.MmRelaySwitchNode.CurrentName
get

MmRoutingTable name of FSM current state.

◆ this[string state]

StateEvents MercuryMessaging.MmRelaySwitchNode.this[string state]
getset

Accessor for particular state by name.

Parameters
stateName of target state.
Returns
FSM State if present.

The documentation for this class was generated from the following file: