예제 #1
0
 public void AddEnity(IEnity enity)
 {
     if (!_enitys.ContainsKey(enity))
     {
         _enitys.Add(enity, new EnityComponents(_moudle));
     }
 }
예제 #2
0
            private EnityComponents FindComponent(IEnity enity)
            {
                EnityComponents comp;

                _enitys.TryGetValue(enity, out comp);
                return(comp);
            }
예제 #3
0
            internal void ReFreshComponent(IEnity enity, Type type, IComponent component)
            {
                EnityComponents comp = FindComponent(enity);

                if (comp == null)
                {
                    throw new Exception("Not Exist Enity");
                }
                comp.ReFreshComponent(type, component);
            }
예제 #4
0
            internal IComponent AddComponent(IEnity enity, IComponent component)
            {
                EnityComponents comp = FindComponent(enity);

                if (comp == null)
                {
                    throw new Exception("Not Exist Enity");
                }
                return(comp.AddComponet(component));
            }
예제 #5
0
            internal IComponent GetComponent(IEnity enity, Type type)
            {
                EnityComponents comp = FindComponent(enity);

                if (comp == null)
                {
                    throw new Exception("Not Exist Enity");
                }
                return(comp.GetComponent(type));
            }
예제 #6
0
            internal void UnSubscribeEnity(IEnity enity)
            {
                EnityComponents comp = FindComponent(enity);

                if (comp == null)
                {
                    throw new Exception("Not Exist Enity");
                }
                comp.Dispose();
                _enitys.Remove(enity);
            }
예제 #7
0
 internal IComponent AddComponent(IEnity enity, IComponent component)
 {
     return(_enitys.AddComponent(enity, component));
 }
예제 #8
0
 /// <summary>
 /// 解除注册实体
 /// </summary>
 /// <param name="enity"></param>
 public void UnSubscribeEnity(IEnity enity)
 {
     enity._mou = null;
     _enitys.UnSubscribeEnity(enity);
 }
예제 #9
0
 internal void RemoveComponent(IEnity enity, Type type)
 {
     _enitys.RemoveComponent(enity, type);
 }
예제 #10
0
 internal IComponent GetComponent(IEnity enity, Type type)
 {
     return(_enitys.GetComponent(enity, type));
 }
예제 #11
0
 internal IComponent AddComponent(IEnity enity, Type type)
 {
     return(_enitys.AddComponent(enity, type));
 }
예제 #12
0
 internal void ReFreshComponent(IEnity enity, Type type, IComponent component)
 {
     _enitys.ReFreshComponent(enity, type, component);
 }