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

                _enitys.TryGetValue(enity, out comp);
                return(comp);
            }
Exemplo n.º 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);
            }
Exemplo n.º 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));
            }
Exemplo n.º 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));
            }
Exemplo n.º 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);
            }
Exemplo n.º 7
0
 internal IComponent AddComponent(IEnity enity, IComponent component)
 {
     return(_enitys.AddComponent(enity, component));
 }
Exemplo n.º 8
0
 /// <summary>
 /// 解除注册实体
 /// </summary>
 /// <param name="enity"></param>
 public void UnSubscribeEnity(IEnity enity)
 {
     enity._mou = null;
     _enitys.UnSubscribeEnity(enity);
 }
Exemplo n.º 9
0
 internal void RemoveComponent(IEnity enity, Type type)
 {
     _enitys.RemoveComponent(enity, type);
 }
Exemplo n.º 10
0
 internal IComponent GetComponent(IEnity enity, Type type)
 {
     return(_enitys.GetComponent(enity, type));
 }
Exemplo n.º 11
0
 internal IComponent AddComponent(IEnity enity, Type type)
 {
     return(_enitys.AddComponent(enity, type));
 }
Exemplo n.º 12
0
 internal void ReFreshComponent(IEnity enity, Type type, IComponent component)
 {
     _enitys.ReFreshComponent(enity, type, component);
 }