Example #1
0
        public Message(IAgentId senderId, IAgentId receiverId, MessageAction action, byte subject,
                       MessageAttachments attachments)
            : this(senderId, receiverId, action, subject)
        {
            if (attachments == null)
            {
                return;
            }

            Attachments = attachments;
        }
Example #2
0
        public Message(IAgentId senderId, IAgentId receiverId, MessageAction action, byte subject,
                       MessageAttachments attachments, CommunicationMediums medium)
            : this(senderId, receiverId, action, subject, medium)
        {
            if (attachments == null)
            {
                return;
            }

            Attachments = attachments;
        }
Example #3
0
        public Message(IAgentId senderId, IAgentId receiverId, MessageAction action, byte subject, object attachment)
            : this(senderId, receiverId, action, subject)
        {
            if (attachment == null)
            {
                return;
            }

            Attachments = new MessageAttachments();
            Attachments.Add(attachment);
        }
Example #4
0
        /// <summary>
        ///     Copy attachments to another messageAttachments
        ///     Use to prevent bad behaviour when you use :
        ///     messageA.Attachments = messageB.Attachments
        /// </summary>
        /// <param name="attachments"></param>
        public void Copy(MessageAttachments attachments)
        {
            if (attachments is null)
            {
                throw new ArgumentNullException(nameof(attachments));
            }

            Objects.AddRange(attachments.Objects);
            KnowledgeId   = attachments.KnowledgeId;
            KnowledgeBit  = attachments.KnowledgeBit;
            KnowledgeBits = attachments.KnowledgeBits;
            BeliefBits    = attachments.BeliefBits;
        }