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

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