Ejemplo n.º 1
0
 /**
  * This is the preferred method to use when retrieving a component from a entity. It will provide good performance.
  *
  * @param type in order to retrieve the component fast you must provide a ComponentType instance for the expected component.
  * @return
  */
 public Component GetComponent(ComponentType type)
 {
     System.Diagnostics.Debug.Assert(type != null);
     return(entityManager.GetComponent(this, type));
 }
Ejemplo n.º 2
0
 /**
  * This is the preferred method to use when retrieving a component from a entity. It will provide good performance.
  *
  * @param type in order to retrieve the component fast you must provide a ComponentType instance for the expected component.
  * @return
  */
 public Component GetComponent(ComponentType type)
 {
     return(entityManager.GetComponent(this, type));
 }
Ejemplo n.º 3
0
 public T Get(Entity e)
 {
     return((T)em.GetComponent(e, type));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Gets the component for the given entity/component type combo
 /// </summary>
 /// <param name="e">Entity in which you are interested</param>
 /// <returns>Component</returns>
 public T Get(Entity e)
 {
     System.Diagnostics.Debug.Assert(e != null);
     return((T)em.GetComponent(e, type));
 }