public void Remove(ECComponent component) { Debug.WarnIf(_componentsToRemove.Contains(component), "You are trying to remove a Component ({0}) that you already removed", component); // this may not be a live Component so we have to watch out for if it hasnt been processed yet but it is being removed in the same frame if (_componentsToAdd.Contains(component)) { _componentsToAdd.Remove(component); return; } _componentsToRemove.Add(component); }
void HandleRemove(ECComponent component) { // deal with renderLayer list if necessary if (component is ECRenderable) { _entity.Scene.RenderableComponents.Remove(component as ECRenderable); } // deal with IUpdatable if (component is IUpdatable) { _updatableComponents.Remove(component as IUpdatable); } component.OnRemovedFromEntity(); component.Entity = null; }
public static void RemoveComponent(this ECComponent self) { self.Entity.RemoveComponent(self); }
public static void RemoveComponent(this ECComponent self, ECComponent component) { self.Entity.RemoveComponent(component); }
public static bool RemoveComponent <T>(this ECComponent self) where T : ECComponent { return(self.Entity.RemoveComponent <T>()); }
public static List <T> GetComponents <T>(this ECComponent self) where T : ECComponent { return(self.Entity.GetComponents <T>()); }
public static void GetComponents <T>(this ECComponent self, List <T> componentList) where T : class { self.Entity.GetComponents <T>(componentList); }
public static bool HasComponent <T>(this ECComponent self) where T : ECComponent => self.Entity.HasComponent <T>();
public static T AddComponent <T>(this ECComponent self) where T : ECComponent, new() { return(self.Entity.AddComponent <T>()); }
public static T AddComponent <T>(this ECComponent self, T component) where T : ECComponent { return(self.Entity.AddComponent(component)); }
public void Add(ECComponent component) { _componentsToAdd.Add(component); }