示例#1
0
 public Entity(params IComponent[] components)
 {
     Id = Guid.NewGuid();
     foreach (IComponent component in components)
     {
         EntityInfrastructureManager.AddComponent(this, component);
     }
     EntityInfrastructureManager.AddEntity(this);
 }
示例#2
0
 public List <IComponent> GetAllComponents()
 {
     return(EntityInfrastructureManager.GetAllComponents(Id));
 }
示例#3
0
 public void RemoveComponentOfType <ComponentType>() where ComponentType : IComponent
 {
     EntityInfrastructureManager.RemoveComponent <ComponentType>(this);
 }
示例#4
0
 public ComponentType GetComponentOfType <ComponentType>() where ComponentType : IComponent
 {
     return(EntityInfrastructureManager.GetComponent <ComponentType>(Id));
 }
示例#5
0
 public void AddComponent <ComponentType>(ComponentType component) where ComponentType : IComponent
 {
     EntityInfrastructureManager.AddComponent(this, component);
 }
示例#6
0
 public Entity(Guid Id)
 {
     this.Id = Id;
     EntityInfrastructureManager.AddEntity(this);
 }
示例#7
0
 public Entity()
 {
     Id = Guid.NewGuid();
     EntityInfrastructureManager.AddEntity(this);
 }
示例#8
0
 public void RemoveComponent <T>(T component) where T : IComponent
 {
     EntityInfrastructureManager.RemoveComponent(component, Id);
 }