6 class SCR_MailboxComponent : AICommunicationComponent
8 #ifdef AI_MAILBOX_OVERFLOW_DETECTION
9 protected int m_iMailboxOverflowCount = 0;
55 map<typename, int> msgTypeCount =
new map<typename, int>();
56 int msgCount = GetMessageCount();
57 for (
int i = 0; i < msgCount; i++)
62 typename msgFinalType = msg.Type();
63 int nMsgsOfType = msgTypeCount.Get(msgFinalType);
65 msgTypeCount.Set(msgFinalType, nMsgsOfType);
68 Print(
string.Format(
"SCR_MailboxComponent statistics: count: %1, %2, %3", GetMessageCount(),
this, GetAIAgent()), logLevel);
69 foreach (
typename t,
int count : msgTypeCount)
71 Print(
string.Format(
" %1: %2", t, count), logLevel);
73 Print(
string.Format(
" Total: %1", GetMessageCount()), logLevel);
88 void DebugLogBroadcastMessage(AIMessage message)
90 AIAgent agent = GetAIAgent();
93 string debugTextBasic =
string.Format(
"----> SendMessage: %1 --> %2:\n", agent, message.GetReceiver());
97 debugText = debugTextBasic + msgBase.GetDebugText();
99 debugText = debugTextBasic +
string.Format(
"\t%1", message);
102 AddDebugMessage(debugText);
108 void DebugLogOnReceived(AIMessage message)
110 AIAgent agent = GetAIAgent();
112 AIAgent sender = message.GetSender();
114 string debugTextBasic =
string.Format(
"<---- RecvMessage: %1 <-- %2\n", agent, sender);
120 debugText = debugTextBasic + msgBase.GetDebugText();
122 debugText = debugTextBasic +
string.Format(
"\t%1", message);
125 AddDebugMessage(debugText);
129 protected void AddDebugMessage(
string str)
131 SCR_AIInfoBaseComponent infoComp = SCR_AIInfoBaseComponent.Cast(GetAIAgent().FindComponent(SCR_AIInfoBaseComponent));