예제 #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);
 }