Exemple #1
0
        public void DestroyFsm(IFsm fsm)
        {
            if (fsm == null)
            {
                throw new DrbException("状态机不能为空");
            }

            fsm.Shutdown();
            m_FsmDic.Remove(fsm.Name);
        }
Exemple #2
0
        public void DestroyFsm(string name)
        {
            IFsm fsm = GetFsm(name);

            if (fsm == null)
            {
                throw new DrbException("不存在状态机{0}", name);
            }
            fsm.Shutdown();
            m_FsmDic.Remove(name);
        }
        /// <summary>
        /// 销毁状态机
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public bool DestroyFsm(string name)
        {
            IFsm fsm = null;

            if (m_Fsms.TryGetValue(name, out fsm))
            {
                fsm.Shutdown();
                return(m_Fsms.Remove(name));
            }
            return(false);
        }
Exemple #4
0
        private bool InternalDestroyFsm(Type ownerType, string name)
        {
            string key = Utility.Text.Format("{0}.{1}", ownerType.FullName, name);
            IFsm   fsm = null;

            if (m_Fsms.TryGetValue(key, out fsm))
            {
                fsm.Shutdown();
                return(m_Fsms.Remove(key));
            }

            return(false);
        }