//--------------------------------------------------------------------- public Entity(EntityMgr entity_mgr) { EntityMgr = entity_mgr; }
//--------------------------------------------------------------------- // 直接销毁该Entity internal void _destroy() { if (SignDestroy) { return; } SignDestroy = true; // 先销毁所有子Entity if (mMapChild != null) { Dictionary <string, Dictionary <string, Entity> > map_children = new Dictionary <string, Dictionary <string, Entity> >(mMapChild); foreach (var i in map_children) { List <string> list_entity = new List <string>(i.Value.Keys); foreach (var j in list_entity) { EntityMgr.destroyEntity(j); } } map_children.Clear(); } // 销毁Entity上挂接的所有组件 mListComponent.Reverse(); foreach (var i in mListComponent) { if (!EbTool.isNull(i)) { i.release(); } } mListComponent.Clear(); mMapComponent.Clear(); if (mPublisher != null) { mPublisher.removeHandler(this); } if (mMapCacheData != null) { mMapCacheData.Clear(); } if (mMapChild != null) { mMapChild.Clear(); mMapChild = null; } // 从父Entity中移除 if (Parent != null) { Parent.removeChild(this); } Type = ""; Guid = ""; mParent = null; }
//--------------------------------------------------------------------- public EbGrid(EntityMgr entity_mgr) { mEntityMgr = entity_mgr; }
//--------------------------------------------------------------------- public EbGridRegion(EntityMgr entity_mgr) { Publisher = new EntityEventPublisher(entity_mgr); SetEntity = new HashSet <Entity>(); }
//------------------------------------------------------------------------- public ComponentFactory(EntityMgr entity_mgr) : base(entity_mgr) { }
//------------------------------------------------------------------------- public IComponentFactory(EntityMgr entity_mgr) { mEntityMgr = entity_mgr; }