Package gaiasky.scene

Class Archetype

java.lang.Object
gaiasky.scene.Archetype

public class Archetype extends Object
An archetype is a class of Entity containing a pre-defined set of Components for convenient creation and extension.
  • Constructor Details

    • Archetype

      public Archetype(com.badlogic.ashley.core.Engine engine, Archetype parent, String name, Class<? extends com.badlogic.ashley.core.Component>... componentClasses)
    • Archetype

      public Archetype(com.badlogic.ashley.core.Engine engine, String name, Class<? extends com.badlogic.ashley.core.Component>... componentClasses)
  • Method Details

    • getFamily

      public com.badlogic.ashley.core.Family getFamily()
    • createEntity

      public com.badlogic.ashley.core.Entity createEntity()
    • addComponentsRecursive

      public void addComponentsRecursive(com.badlogic.ashley.core.Entity entity)
    • numComponents

      public int numComponents()
    • hasComponent

      public boolean hasComponent(com.badlogic.ashley.core.Component component)
    • matches

      public boolean matches(com.badlogic.ashley.core.Entity entity)
      Checks whether the given entity matches this archetype.
      Parameters:
      entity - The entity.
      Returns:
      True if the entity is of this archetype (has the same components), false otherwise.
    • getName

      public String getName()