public void AddEnity(IEnity enity) { if (!_enitys.ContainsKey(enity)) { _enitys.Add(enity, new EnityComponents(_moudle)); } }
private EnityComponents FindComponent(IEnity enity) { EnityComponents comp; _enitys.TryGetValue(enity, out comp); return(comp); }
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); }
internal IComponent AddComponent(IEnity enity, IComponent component) { EnityComponents comp = FindComponent(enity); if (comp == null) { throw new Exception("Not Exist Enity"); } return(comp.AddComponet(component)); }
internal IComponent GetComponent(IEnity enity, Type type) { EnityComponents comp = FindComponent(enity); if (comp == null) { throw new Exception("Not Exist Enity"); } return(comp.GetComponent(type)); }
internal void UnSubscribeEnity(IEnity enity) { EnityComponents comp = FindComponent(enity); if (comp == null) { throw new Exception("Not Exist Enity"); } comp.Dispose(); _enitys.Remove(enity); }
internal IComponent AddComponent(IEnity enity, IComponent component) { return(_enitys.AddComponent(enity, component)); }
/// <summary> /// 解除注册实体 /// </summary> /// <param name="enity"></param> public void UnSubscribeEnity(IEnity enity) { enity._mou = null; _enitys.UnSubscribeEnity(enity); }
internal void RemoveComponent(IEnity enity, Type type) { _enitys.RemoveComponent(enity, type); }
internal IComponent GetComponent(IEnity enity, Type type) { return(_enitys.GetComponent(enity, type)); }
internal IComponent AddComponent(IEnity enity, Type type) { return(_enitys.AddComponent(enity, type)); }
internal void ReFreshComponent(IEnity enity, Type type, IComponent component) { _enitys.ReFreshComponent(enity, type, component); }