/// <summary>
        /// Removes a message belonging to the passed agent (by id) where the message type is equal to the passed message type. This method does nothing
        /// if the agent does not have any messages of the passed message type.
        /// </summary>
        /// <param name="agentId">Agent identifier.</param>
        /// <param name="messageType">Message type.</param>
        public void RemoveMessageForAgentByType(Guid agentId, SimulationMessageType messageType)
        {
            var             labelMessagesForSingleAgent = GetMessagesForAgent(agentId);
            SimulationLabel labelToRemove;
            bool            success = labelMessagesForSingleAgent.TryGetValue(messageType, out labelToRemove);

            if (!success)
            {
                return;
            }

            labelToRemove.Dispose();
            labelMessagesForSingleAgent.Remove(messageType);
        }
Beispiel #2
0
 public SimulationMessage(Vector position, string text, SimulationMessageType type)
 {
     Position = position;
     Text     = text;
     Type     = type;
 }
        private void SendEmployeeMessageToUserInterface(Employee employee, string messageText, SimulationMessageType messageType)
        {
            var message = SimulationMessageFactory.Create(employee.ProjectedPosition, messageText, messageType);

            userInterfaceManager.AddMessageForAgent(employee.ID, message);
        }
 public static SimulationMessage Create(Vector position, string messageText, SimulationMessageType messageType)
 {
     return(new SimulationMessage(position, messageText, messageType));
 }