コード例 #1
0
 /// <summary>
 /// Create an MmMessage, with control block, MmMethod, and a string
 /// </summary>
 /// <param name="initVal">String payload</param>
 /// <param name="mmMethod">Identifier of target MmMethod</param>
 /// <param name="metadataBlock">Object defining the routing of messages</param>
 public MmMessageString(string initVal,
                        MmMethod mmMethod             = default(MmMethod),
                        MmMetadataBlock metadataBlock = null)
     : base(mmMethod, metadataBlock)
 {
     value = initVal;
 }
コード例 #2
0
 /// <summary>
 /// Create an MmMessage, with control block, MmMethod, and an int
 /// </summary>
 /// <param name="iVal">Int payload</param>
 /// <param name="mmMethod">Identifier of target MmMethod</param>
 /// <param name="metadataBlock">Object defining the routing of messages</param>
 public MmMessageInt(int iVal,
                     MmMethod mmMethod             = default(MmMethod),
                     MmMetadataBlock metadataBlock = null)
     : base(mmMethod, MmMessageType.MmInt, metadataBlock)
 {
     value = iVal;
 }
コード例 #3
0
 /// <summary>
 /// Create an MmMessage, with control block, MmMethod, and float
 /// </summary>
 /// <param name="iVal">Float payload</param>
 /// <param name="mmMethod">Identifier of target MmMethod</param>
 /// <param name="metadataBlock">Object defining the routing of messages</param>
 public MmMessageFloat(float iVal,
                       MmMethod mmMethod             = default(MmMethod),
                       MmMetadataBlock metadataBlock = null)
     : base(mmMethod, metadataBlock)
 {
     value = iVal;
 }
コード例 #4
0
        /// <summary>
        /// Invoke an MmMethod with no parameter.
        /// </summary>
        /// <param name="mmMethod">MmMethod Identifier - <see cref="MmMethod"/></param>
        /// <param name="metadataBlock">Object defining the routing of
        /// Mmessages through MercuryMessaging Hierarchies. <see cref="MmMetadataBlock"/></param>
        public virtual void MmInvoke(MmMethod mmMethod,
                                     MmMetadataBlock metadataBlock = null)
        {
            MmMessage msg = new MmMessage(mmMethod, metadataBlock);

            MmInvoke(MmMessageType.MmVoid, msg);
        }
コード例 #5
0
 /// <summary>
 /// Create an MmMessage, with control block, MmMethod, and a Vector4
 /// </summary>
 /// <param name="iVal">Vector4 payload</param>
 /// <param name="mmMethod">Identifier of target MmMethod</param>
 /// <param name="metadataBlock">Object defining the routing of messages</param>
 public MmMessageVector4(Vector4 iVal,
                         MmMethod mmMethod             = default(MmMethod),
                         MmMetadataBlock metadataBlock = null)
     : base(mmMethod, metadataBlock)
 {
     value = iVal;
 }
コード例 #6
0
 /// <summary>
 /// Create an MmMessage, with control block, MmMethod, and byte array
 /// </summary>
 /// <param name="iVal">Byte array payload</param>
 /// <param name="mmMethod">Identifier of target MmMethod</param>
 /// <param name="metadataBlock">Object defining the routing of messages</param>
 public MmMessageByteArray(byte[] iVal,
                           MmMethod mmMethod             = default(MmMethod),
                           MmMetadataBlock metadataBlock = null)
     : base(mmMethod, metadataBlock)
 {
     byteArr = iVal;
 }
コード例 #7
0
 /// <summary>
 /// Create an MmMessage, with control block, MmMethod, and an MmTransform
 /// </summary>
 /// <param name="transform">MmTransform payload</param>
 /// <param name="mmMethod">Identifier of target MmMethod</param>
 /// <param name="metadataBlock">Object defining the routing of messages</param>
 public MmMessageTransform(MmTransform transform,
                           MmMethod mmMethod             = default(MmMethod),
                           MmMetadataBlock metadataBlock = null)
     : base(mmMethod, MmMessageType.MmTransform, metadataBlock)
 {
     MmTransform = transform;
 }
コード例 #8
0
 /// <summary>
 /// Create an MmMessage, with control block, MmMethod, and an GameObject
 /// </summary>
 /// <param name="transform">MmTransform payload</param>
 /// <param name="mmMethod">Identifier of target MmMethod</param>
 /// <param name="metadataBlock">Object defining the routing of messages</param>
 public MmMessageGameObject(GameObject gameObject,
                            MmMethod mmMethod             = default(MmMethod),
                            MmMetadataBlock metadataBlock = null)
     : base(mmMethod, metadataBlock)
 {
     Value = gameObject;
 }
コード例 #9
0
 /// <summary>
 /// Create an MmMessage, with control block, MmMethod, and a
 /// list of MmTransforms
 /// </summary>
 /// <param name="iTransforms">List of transforms to send in payload</param>
 /// <param name="mmMethod">Identifier of target MmMethod</param>
 /// <param name="metadataBlock">Object defining the routing of messages</param>
 public MmMessageTransformList(List <MmTransform> iTransforms,
                               MmMethod mmMethod             = default(MmMethod),
                               MmMetadataBlock metadataBlock = null)
     : base(mmMethod, MmMessageType.MmTransformList, metadataBlock)
 {
     transforms = iTransforms;
 }
コード例 #10
0
 /// <summary>
 /// Create an MmMessage, with defined control block, MmMethod, and boolean value
 /// </summary>
 /// <param name="iVal">Boolean value</param>
 /// <param name="mmMethod">Identifier of target MmMethod</param>
 /// <param name="metadataBlock">Object defining the routing of messages</param>
 public MmMessageBool(bool iVal,
                      MmMethod mmMethod             = default(MmMethod),
                      MmMetadataBlock metadataBlock = null)
     : base(mmMethod, MmMessageType.MmBool, metadataBlock)
 {
     value = iVal;
 }
コード例 #11
0
 /// <summary>
 /// Create an MmMessage, with control block, MmMethod, and a Vector3
 /// </summary>
 /// <param name="iVal">Vector3 payload</param>
 /// <param name="mmMethod">Identifier of target MmMethod</param>
 /// <param name="metadataBlock">Object defining the routing of messages</param>
 public MmMessageVector3(Vector3 iVal,
                         MmMethod mmMethod             = default(MmMethod),
                         MmMetadataBlock metadataBlock = null)
     : base(mmMethod, MmMessageType.MmVector3, metadataBlock)
 {
     value = iVal;
 }
コード例 #12
0
 /// <summary>
 /// Create an MmMessage, with control block, MmMethod, and an int
 /// </summary>
 /// <param name="iVal">Serializable Payload</param>
 /// <param name="mmMethod">Identifier of target MmMethod</param>
 /// <param name="metadataBlock">Object defining the routing of messages</param>
 public MmMessageSerializable(IMmSerializable iVal,
                              MmMethod mmMethod             = default(MmMethod),
                              MmMetadataBlock metadataBlock = null)
     : base(mmMethod, MmMessageType.MmSerializable, metadataBlock)
 {
     value = iVal;
 }
コード例 #13
0
        /// Invoke an MmMethod with parameter: GameObject.
        /// </summary>
        /// <param name="mmMethod">MmMethod Identifier - <see cref="MmMethod"/></param>
        /// <param name="param">MmMethod parameter: GameObject. <see cref="MmMessage"/> </param>
        /// <param name="metadataBlock">Object defining the routing of
        /// Mmessages through MercuryMessaging Hierarchies. <see cref="MmMetadataBlock"/></param>
        public virtual void MmInvoke(MmMethod mmMethod,
                                     GameObject param,
                                     MmMetadataBlock metadataBlock = null)
        {
            MmMessage msg = new MmMessageGameObject(param, mmMethod, metadataBlock);

            MmInvoke(msg);
        }
コード例 #14
0
        /// <summary>
        /// Invoke an MmMethod with parameter: MmTransform.
        /// </summary>
        /// <param name="mmMethod">MmMethod Identifier - <see cref="MmMethod"/></param>
        /// <param name="param">MmMethod parameter: MmTransform. <see cref="MmTransform"/></param>
        /// <param name="metadataBlock">Object defining the routing of
        /// Mmessages through MercuryMessaging Hierarchies. <see cref="MmMetadataBlock"/></param>
        public virtual void MmInvoke(MmMethod mmMethod,
                                     MmTransform param,
                                     MmMetadataBlock metadataBlock = null)
        {
            MmMessage msg = new MmMessageTransform(param, mmMethod, metadataBlock);

            MmInvoke(msg);
        }
コード例 #15
0
        /// <summary>
        /// Invoke an MmMethod with parameter: float.
        /// </summary>
        /// <param name="mmMethod">MmMethod Identifier - <see cref="MmMethod"/></param>
        /// <param name="param">MmMethod parameter: float.</param>
        /// <param name="metadataBlock">Object defining the routing of
        /// Mmessages through MercuryMessaging Hierarchies. <see cref="MmMetadataBlock"/></param>
        public virtual void MmInvoke(MmMethod mmMethod,
                                     float param,
                                     MmMetadataBlock metadataBlock = null)
        {
            MmMessage msg = new MmMessageFloat(param, mmMethod, metadataBlock);

            MmInvoke(MmMessageType.MmFloat, msg);
        }
コード例 #16
0
        /// <summary>
        /// Invoke an MmMethod with parameter: IMmSerializable.
        /// </summary>
        /// <param name="mmMethod">MmMethod Identifier - <see cref="MmMethod"/></param>
        /// <param name="param">MmMethod parameter: IMmSerializable. <see cref="IMmSerializable"/> </param>
        /// <param name="metadataBlock">Object defining the routing of
        /// Mmessages through MercuryMessaging Hierarchies. <see cref="MmMetadataBlock"/></param>
        public virtual void MmInvoke(MmMethod mmMethod,
                                     IMmSerializable param,
                                     MmMetadataBlock metadataBlock = null)
        {
            MmMessage msg = new MmMessageSerializable(param, mmMethod, metadataBlock);

            MmInvoke(MmMessageType.MmSerializable, msg);
        }
コード例 #17
0
 /// <summary>
 /// Copy Constructor for MmMetadataBlock
 /// </summary>
 /// <param name="original">MmMetadataBlock to be copied.</param>
 public MmMetadataBlock(MmMetadataBlock original)
 {
     LevelFilter    = original.LevelFilter;
     ActiveFilter   = original.ActiveFilter;
     SelectedFilter = original.SelectedFilter;
     NetworkFilter  = original.NetworkFilter;
     Tag            = original.Tag;
 }
コード例 #18
0
        /// <summary>
        /// Invoke an MmMethod with parameter: byte array.
        /// </summary>
        /// <param name="mmMethod">MmMethod Identifier - <see cref="MmMethod"/></param>
        /// <param name="param">MmMethod parameter: byte array.</param>
        /// <param name="metadataBlock">Object defining the routing of
        /// Mmessages through MercuryMessaging Hierarchies. <see cref="MmMetadataBlock"/></param>
        public virtual void MmInvoke(MmMethod mmMethod,
                                     byte[] param,
                                     MmMetadataBlock metadataBlock = null)
        {
            MmMessage msg = new MmMessageByteArray(param, mmMethod, metadataBlock);

            MmInvoke(MmMessageType.MmByteArray, msg);
        }
コード例 #19
0
        /// <summary>
        /// Invoke an MmMethod with parameter: List<MmTransform>.
        /// </summary>
        /// <param name="mmMethod">MmMethod Identifier - <see cref="MmMethod"/></param>
        /// <param name="param">MmMethod parameter: List<MmTransform>.</param>
        /// <param name="metadataBlock">Object defining the routing of
        /// Mmessages through MercuryMessaging Hierarchies. <see cref="MmMetadataBlock"/></param>
        public virtual void MmInvoke(MmMethod mmMethod,
                                     List <MmTransform> param,
                                     MmMetadataBlock metadataBlock = null)
        {
            MmMessage msg = new MmMessageTransformList(param, mmMethod, metadataBlock);

            MmInvoke(MmMessageType.MmTransformList, msg);
        }
コード例 #20
0
        /// <summary>
        /// Invoke an MmMethod with parameter: string.
        /// </summary>
        /// <param name="mmMethod">MmMethod Identifier - <see cref="MmMethod"/></param>
        /// <param name="param">MmMethod parameter: string.</param>
        /// <param name="metadataBlock">Object defining the routing of
        /// Mmessages through MercuryMessaging Hierarchies. <see cref="MmMetadataBlock"/></param>
        public virtual void MmInvoke(MmMethod mmMethod,
                                     string param,
                                     MmMetadataBlock metadataBlock = null)
        {
            MmMessage msg = new MmMessageString(param, mmMethod, metadataBlock);

            MmInvoke(MmMessageType.MmString, msg);
        }
コード例 #21
0
        /// <summary>
        /// Invoke an MmMethod with parameter: Vector4.
        /// </summary>
        /// <param name="mmMethod">MmMethod Identifier - <see cref="MmMethod"/></param>
        /// <param name="param">MmMethod parameter: Vector4.</param>
        /// <param name="metadataBlock">Object defining the routing of
        /// Mmessages through MercuryMessaging Hierarchies. <see cref="MmMetadataBlock"/></param>
        public virtual void MmInvoke(MmMethod mmMethod,
                                     Vector4 param,
                                     MmMetadataBlock metadataBlock = null)
        {
            MmMessage msg = new MmMessageVector4(param, mmMethod, metadataBlock);

            MmInvoke(MmMessageType.MmVector4, msg);
        }
コード例 #22
0
        /// <summary>
        /// Invoke an MmMethod with parameter: bool.
        /// </summary>
        /// <param name="mmMethod">MmMethod Identifier - <see cref="MmMethod"/></param>
        /// <param name="param">MmMethod parameter: bool.</param>
        /// <param name="metadataBlock">Object defining the routing of
        /// Mmessages through MercuryMessaging Hierarchies. <see cref="MmMetadataBlock"/></param>
        public virtual void MmInvoke(MmMethod mmMethod,
                                     bool param,
                                     MmMetadataBlock metadataBlock = null)
        {
            MmMessage msg = new MmMessageBool(param, mmMethod, metadataBlock);

            MmInvoke(MmMessageType.MmBool, msg);
        }
コード例 #23
0
 /// <summary>
 /// Create an MmMessage, with control block, MmMethod, and an MmTransform
 /// </summary>
 /// <param name="transform">MmTransform payload</param>
 /// <param name="globalTransform">Should message recipient apply to global or local transform?</param>
 /// <param name="mmMethod">Identifier of target MmMethod</param>
 /// <param name="metadataBlock">Object defining the routing of messages</param>
 public MmMessageTransform(MmTransform transform,
                           bool localTransform,
                           MmMethod mmMethod             = default(MmMethod),
                           MmMetadataBlock metadataBlock = null)
     : base(mmMethod, metadataBlock)
 {
     MmTransform    = transform;
     LocalTransform = localTransform;
 }
コード例 #24
0
        /// Invoke a general MmMethod with parameter: MmMessage.
        /// </summary>
        /// <param name="mmMethod">MmMethod Identifier - <see cref="MmMethod"/></param>
        /// <param name="param">MmMethod parameter: MmMessage. <see cref="MmMessage"/> </param>
        /// <param name="metadataBlock">Object defining the routing of
        /// Mmessages through MercuryMessaging Hierarchies. <see cref="MmMetadataBlock"/></param>
        public virtual void MmInvoke(MmMethod mmMethod,
                                     MmMessage param,
                                     MmMessageType msgType,
                                     MmMetadataBlock metadataBlock = null)
        {
            MmMessage msg = param.Copy();

            msg.MmMethod      = mmMethod;
            msg.MetadataBlock = metadataBlock;
            MmInvoke(msg);
        }
コード例 #25
0
ファイル: MmMessage.cs プロジェクト: rjb2179/MercuryMessaging
        /// <summary>
        /// Create an MmMessage, with filters defined directly
        /// </summary>
        /// <param name="mmMethod">Identifier of target MmMethod</param>
        /// <param name="levelFilter">Determines direction of messages</param>
        /// <param name="activeFilter">Determines whether message sent to active and/or inactive objects</param>
        /// <param name="selectedFilter">Determines whether message sent to objects "selected" as defined by MmRelayNode implementation</param>
        /// <param name="networkFilter">Determines whether message will remain local or can be sent over the network</param>
        public MmMessage(MmMethod mmMethod,
                         MmLevelFilter levelFilter,
                         MmActiveFilter activeFilter,
                         MmSelectedFilter selectedFilter,
                         MmNetworkFilter networkFilter)
        {
            MmMethod = mmMethod;

            MetadataBlock                = new MmMetadataBlock();
            MetadataBlock.LevelFilter    = levelFilter;
            MetadataBlock.ActiveFilter   = activeFilter;
            MetadataBlock.SelectedFilter = selectedFilter;
            MetadataBlock.NetworkFilter  = networkFilter;
        }
コード例 #26
0
ファイル: MmMessage.cs プロジェクト: rjb2179/MercuryMessaging
        /// <summary>
        /// Create an MmMessage, with defined control block and MmMethod
        /// </summary>
        /// <param name="mmMethod">Identifier of target MmMethod</param>
        /// <param name="metadataBlock">Object defining the routing of messages through MercuryMessaging Hierarchys.</param>
        public MmMessage(MmMethod mmMethod,
                         MmMetadataBlock metadataBlock = null)
        {
            MmMethod = mmMethod;

            if (metadataBlock != null)
            {
                MetadataBlock = new MmMetadataBlock(metadataBlock);
            }
            else
            {
                MetadataBlock = new MmMetadataBlock();
            }
        }
コード例 #27
0
        /// <summary>
        /// Create an MmMessage, with defined control block and MmMethod
        /// </summary>
        /// <param name="mmMethod">Identifier of target MmMethod</param>
        /// <param name="msgType">Type of Mercury Message.</param>
        /// <param name="metadataBlock">Object defining the routing of messages through MercuryMessaging Hierarchys.</param>
        public MmMessage(MmMethod mmMethod,
                         MmMessageType msgType         = default(MmMessageType),
                         MmMetadataBlock metadataBlock = null)
        {
            MmMethod      = mmMethod;
            MmMessageType = msgType;

            if (metadataBlock != null)
            {
                MetadataBlock = new MmMetadataBlock(metadataBlock);
            }
            else
            {
                MetadataBlock = new MmMetadataBlock();
            }
        }
コード例 #28
0
 /// <summary>
 /// Creates a basic MmMessageVector4, with a control block
 /// </summary>
 /// <param name="metadataBlock">Object defining the routing of messages</param>
 public MmMessageVector4(MmMetadataBlock metadataBlock = null)
     : base(metadataBlock)
 {
 }
コード例 #29
0
 /// <summary>
 /// Creates a basic MmMessageGameObject, with a control block
 /// </summary>
 /// <param name="metadataBlock">Object defining the routing of messages</param>
 public MmMessageGameObject(MmMetadataBlock metadataBlock = null)
     : base(metadataBlock)
 {
 }
コード例 #30
0
 /// <summary>
 /// Creates a basic MmMessageTransformList,
 /// with a control block
 /// </summary>
 /// <param name="metadataBlock">Object defining the routing of messages</param>
 public MmMessageTransformList(MmMetadataBlock metadataBlock = null)
     : base(metadataBlock, MmMessageType.MmTransformList)
 {
     transforms = new List <MmTransform>();
 }