예제 #1
0
        // 创建转换列表
        private List <CFSMTransition> CreateTransitionListFromXML(List <CFSMXMLTranslation> transitionXMLList)
        {
            if (transitionXMLList == null)
            {
                return(null);
            }
            List <CFSMTransition> tranList = new List <CFSMTransition>();
            Int32 nTransSize = transitionXMLList == null ? 0 : transitionXMLList.Count;

            for (Int32 i = 0; i < nTransSize; ++i)
            {
                CFSMXMLTranslation xmlTrans = transitionXMLList[i];
                if (xmlTrans == null)
                {
                    continue;
                }
                CFSMTransition newTrans = new CFSMTransition(xmlTrans.m_uTargetId);
                if (newTrans.CreateFromXML(xmlTrans) == false)
                {
                    BTMISC.BTDebug.Warning("<BTFSM> Create FSM Transition Failed");
                    continue;
                }
                tranList.Add(newTrans);
            }
            return(tranList);
        }
예제 #2
0
 /// <summary>
 /// 从XML配置创建
 /// </summary>
 /// <param name="xmlTrans"></param>
 /// <returns></returns>
 public bool CreateFromXML(CFSMXMLTranslation xmlTrans)
 {
     if (xmlTrans == null)
     {
         return(false);
     }
     m_uTargetStateId = xmlTrans.m_uTargetId;
     m_PipelineCollection.AddConfigPipel(xmlTrans.m_fsmEventList);
     m_PipelineCollection.AddConfigPipel(xmlTrans.m_fsmConditionList);
     return(true);
 }