/// <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); } }
/// <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(); }