Exemple #1
0
        /// <summary>
        /// 获取状态
        /// </summary>
        /// <param name="t_StateName">状态保存进状态机时名字</param>
        /// <returns>状态的抽象基础状态的实例引用</returns>
        public BaseFSMState GetState(string t_StateName)
        {
            BaseFSMState t_BaseFSMState;

            IStateMapDataStructure.TryGetValue(t_StateName, out t_BaseFSMState);
            return(t_BaseFSMState);
        }
Exemple #2
0
        /// <summary>
        /// 移除状态
        /// </summary>
        /// <param name="t_FSMName"></param>
        public void RemoveState(string t_FSMName)
        {
            BaseFSMState value;

            IStateMapDataStructure.TryGetValue(t_FSMName, out value);

            if (!IStateMapDataStructure.ContainsKey(t_FSMName))
            {
                IStateMapDataStructure.Remove(t_FSMName);
            }

            if (null != value)
            {
                value.OnStateDestroy(this);
            }
        }