Exemple #1
0
        /// <summary>
        /// 销毁所有的GameBox的组件
        /// </summary>
        /// <typeparam name="T">GameBox的组件类型</typeparam>
        /// <returns>返回GamBox的组件</returns>
        public void DestroyComponents <T>() where T : IComponent
        {
            var t_ComponentArray = IListDataStructure.ToArray();

            for (int i = 0; i < t_ComponentArray.Length; i++)
            {
                if (t_ComponentArray[i] is T)
                {
                    IListDataStructure.RemoveNode(component => component.Equals(t_ComponentArray[i]));
                }
            }
        }
Exemple #2
0
 /// <summary>
 /// 销毁指定的GameBox的组件
 /// </summary>
 /// <typeparam name="T">GameBox的组件类型</typeparam>
 /// <returns>返回GamBox的组件</returns>
 public void DestroyComponent(IComponent t_BaseGameBoxComponent)
 {
     if (!IListDataStructure.Contains(t_BaseGameBoxComponent))
     {
         if (null != ComponentDestroyedEventHandler)
         {
             ComponentDestroyedEventHandler(this, new ComponentDestroyedEventArgs()
             {
                 Component = t_BaseGameBoxComponent
             });
         }
         IListDataStructure.RemoveNode(component => component.Equals(t_BaseGameBoxComponent));
     }
     IListDataStructure.Sort();
 }
Exemple #3
0
        /// <summary>
        /// 移除状态机
        /// </summary>
        /// <param name="t_FSMName">状态机名字</param>
        /// <returns>返回状态机管家接口</returns>
        public IFSMManager RemoveFSM(string t_FSMName)
        {
            ////防止内建模块的状态机服务被关闭
            //for (int i = 0; i < BuiltInFSMList.Length; i++)
            //{
            //    if (t_FSMName==BuiltInFSMList[i])
            //    {
            //        return this;
            //    }
            //}

            var t_FSM = IListDataStructure.GetNode(fsm => fsm.m_FSMName == t_FSMName);

            t_FSM.OnDestroy(this);
            IListDataStructure.RemoveNode(fsm => fsm.m_FSMName == t_FSMName);
            return(this);
        }
 /// <summary>
 /// 移除一个事件主题
 /// </summary>
 /// <param name="t_EventTopic">事件主题</param>
 public void RemoveEventTopic(string t_EventTopicName)
 {
     IListDataStructure.RemoveNode(eventTopic => eventTopic.EventTopicName == t_EventTopicName);
 }