public Message(IAgentId senderId, IAgentId receiverId, MessageAction action, byte subject, MessageAttachments attachments) : this(senderId, receiverId, action, subject) { if (attachments == null) { return; } Attachments = attachments; }
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; }
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); }
/// <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; }