public Entity(params IComponent[] components) { Id = Guid.NewGuid(); foreach (IComponent component in components) { EntityInfrastructureManager.AddComponent(this, component); } EntityInfrastructureManager.AddEntity(this); }
public List <IComponent> GetAllComponents() { return(EntityInfrastructureManager.GetAllComponents(Id)); }
public void RemoveComponentOfType <ComponentType>() where ComponentType : IComponent { EntityInfrastructureManager.RemoveComponent <ComponentType>(this); }
public ComponentType GetComponentOfType <ComponentType>() where ComponentType : IComponent { return(EntityInfrastructureManager.GetComponent <ComponentType>(Id)); }
public void AddComponent <ComponentType>(ComponentType component) where ComponentType : IComponent { EntityInfrastructureManager.AddComponent(this, component); }
public Entity(Guid Id) { this.Id = Id; EntityInfrastructureManager.AddEntity(this); }
public Entity() { Id = Guid.NewGuid(); EntityInfrastructureManager.AddEntity(this); }
public void RemoveComponent <T>(T component) where T : IComponent { EntityInfrastructureManager.RemoveComponent(component, Id); }