コード例 #1
0
 /// <summary>
 /// 注册GameBox的组件
 /// </summary>
 /// <typeparam name="T">GameBox的组件类型</typeparam>
 /// <returns>返回GamBox的组件</returns>
 public void RegisterComponent(IComponent t_BaseGameBoxComponent)
 {
     if (!IListDataStructure.Contains(t_BaseGameBoxComponent))
     {
         if (null != ComponentRegisteredEventHandler)
         {
             ComponentRegisteredEventHandler(this, new ComponentRegisteredEventArgs()
             {
                 Component = t_BaseGameBoxComponent
             });
         }
         IListDataStructure.AddNode(t_BaseGameBoxComponent);
     }
 }
コード例 #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();
 }