示例#1
0
文件: FSM.cs 项目: ITsuperFan/GameBox
 /// <summary>
 /// 移除状态机条件
 /// </summary>
 /// <typeparam name="T"></typeparam>
 public void RemoveCondition <T>() where T : BaseFSMCondition
 {
     IConditionMapDataStructure.Foreach((key, value) => {
         if (value is T)
         {
             IStateMapDataStructure.Remove(key);
             value.OnConditionDestroy(this);
         }
     });
 }
示例#2
0
文件: FSM.cs 项目: ITsuperFan/GameBox
 /// <summary>
 /// 移除状态
 /// </summary>
 /// <typeparam name="T">状态类型</typeparam>
 public void RemoveState <T>() where T : BaseFSMState
 {
     IStateMapDataStructure.Foreach((key, value) => {
         if (value is T)
         {
             IStateMapDataStructure.Remove(key);
             value.OnStateDestroy(this);
         }
     });
 }
示例#3
0
文件: FSM.cs 项目: ITsuperFan/GameBox
 /// <summary>
 /// 移除状态
 /// </summary>
 /// <param name="t_StateType">状态类型</param>
 public void RemoveState(Type t_StateType)
 {
     IStateMapDataStructure.Foreach((key, value) => {
         if (value.GetType() == t_StateType)
         {
             IStateMapDataStructure.Remove(key);
             value.OnStateDestroy(this);
         }
     });
 }
示例#4
0
文件: FSM.cs 项目: ITsuperFan/GameBox
        /// <summary>
        /// 移除状态机条件
        /// </summary>
        /// <param name="t_FSMName">状态机条件的类名</param>
        public void RemoveCondition(string t_ConditionName)
        {
            BaseFSMCondition value;

            IConditionMapDataStructure.TryGetValue(t_ConditionName, out value);

            if (!IStateMapDataStructure.ContainsKey(t_ConditionName))
            {
                IStateMapDataStructure.Remove(t_ConditionName);
            }
            if (null != value)
            {
                value.OnConditionDestroy(this);
            }
        }
示例#5
0
文件: FSM.cs 项目: ITsuperFan/GameBox
        /// <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);
            }
        }