protected override bool ExecCommand(StoryInstance instance, long delta) { string msgId = m_MsgId.Value; ArrayList arglist = new ArrayList(); string _namespace = instance.Namespace; if (!string.IsNullOrEmpty(_namespace)) { msgId = string.Format("{0}:{1}", _namespace, msgId); } for (int i = 0; i < m_MsgArgs.Count; i++) { arglist.Add(m_MsgArgs[i].Value); } object[] args = arglist.ToArray(); if (m_IsConcurrent) { instance.SendConcurrentMessage(msgId, args); } else { instance.SendMessage(msgId, args); } return(false); }
public void SendConcurrentMessage(string msgId, params object[] args) { int ct = m_StoryLogicInfos.Count; for (int ix = ct - 1; ix >= 0; --ix) { StoryInstance info = m_StoryLogicInfos[ix]; info.SendConcurrentMessage(msgId, args); } }
public void SendConcurrentMessage(string msgId, BoxedValueList args) { int ct = m_StoryLogicInfos.Count; for (int ix = ct - 1; ix >= 0; --ix) { StoryInstance info = m_StoryLogicInfos[ix]; var newArgs = info.NewBoxedValueList(); newArgs.AddRange(args); info.SendConcurrentMessage(msgId, newArgs); } m_BoxedValueListPool.Recycle(args); }
protected override bool ExecCommand(StoryInstance instance, long delta) { string msgId = m_MsgId.Value; ArrayList arglist = new ArrayList(); for (int i = 0; i < m_MsgArgs.Count; i++) { arglist.Add(m_MsgArgs[i].Value); } object[] args = arglist.ToArray(); if (m_IsConcurrent) { instance.SendConcurrentMessage(msgId, args); } else { instance.SendMessage(msgId, args); } return(false); }
public void SendConcurrentMessage(string msgId, params object[] args) { int ct = m_StoryLogicInfos.Count; for (int ix = ct - 1; ix >= 0; --ix) { StoryInstance info = m_StoryLogicInfos[ix]; info.SendConcurrentMessage(msgId, args); } foreach (var pair in m_AiStoryInstancePool) { var infos = pair.Value; int aiCt = infos.Count; for (int ix = aiCt - 1; ix >= 0; --ix) { if (infos[ix].m_IsUsed && null != infos[ix].m_StoryInstance) { infos[ix].m_StoryInstance.SendConcurrentMessage(msgId, args); } } } }