Exemple #1
0
        public bool DestroyFsm <T>(string name) where T : class
        {
            FsmBase fsm = null;

            if (m_Fsms.TryGetValue(name, out fsm))
            {
                fsm.Shutdown();
                return(m_Fsms.Remove(name));
            }
            return(false);
        }
Exemple #2
0
        private bool InternalDestroyFsm(string fullName)
        {
            FsmBase fsm = null;

            if (m_Fsms.TryGetValue(fullName, out fsm))
            {
                fsm.Shutdown();
                return(m_Fsms.Remove(fullName));
            }
            return(false);
        }
Exemple #3
0
        private bool InternalDestroyFsm(TypeNamePair typeNamePair)
        {
            FsmBase fsm = null;

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

            return(false);
        }
        /// <summary>
        /// 销毁有限状态机。
        /// </summary>
        /// <typeparam name="T">有限状态机持有者类型。</typeparam>
        /// <param name="name">要销毁的有限状态机名称。</param>
        /// <returns>是否销毁有限状态机成功。</returns>
        public bool DestroyFsm <T>(string name) where T : class
        {
            string  fullName = Utility.Text.GetFullName <T>(name);
            FsmBase fsm      = null;

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

            return(false);
        }