Пример #1
0
 //---------------------------------------------------------------------
 public Entity(EntityMgr entity_mgr)
 {
     EntityMgr = entity_mgr;
 }
Пример #2
0
        //---------------------------------------------------------------------
        // 直接销毁该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;
        }
Пример #3
0
 //---------------------------------------------------------------------
 public EbGrid(EntityMgr entity_mgr)
 {
     mEntityMgr = entity_mgr;
 }
Пример #4
0
 //---------------------------------------------------------------------
 public EbGridRegion(EntityMgr entity_mgr)
 {
     Publisher = new EntityEventPublisher(entity_mgr);
     SetEntity = new HashSet <Entity>();
 }
Пример #5
0
 //-------------------------------------------------------------------------
 public ComponentFactory(EntityMgr entity_mgr)
     : base(entity_mgr)
 {
 }
Пример #6
0
 //-------------------------------------------------------------------------
 public IComponentFactory(EntityMgr entity_mgr)
 {
     mEntityMgr = entity_mgr;
 }