Package gaiasky.scene
Class Archetype
java.lang.Object
gaiasky.scene.Archetype
-
Constructor Summary
ConstructorDescriptionArchetype
(com.badlogic.ashley.core.Engine engine, Archetype parent, String name, Class<? extends com.badlogic.ashley.core.Component>... componentClasses) Archetype
(com.badlogic.ashley.core.Engine engine, String name, Class<? extends com.badlogic.ashley.core.Component>... componentClasses) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addComponentsRecursive
(com.badlogic.ashley.core.Entity entity) com.badlogic.ashley.core.Entity
com.badlogic.ashley.core.Family
getName()
boolean
hasComponent
(com.badlogic.ashley.core.Component component) boolean
matches
(com.badlogic.ashley.core.Entity entity) Checks whether the given entity matches this archetype.int
-
Constructor Details
-
Archetype
@SafeVarargs public Archetype(com.badlogic.ashley.core.Engine engine, Archetype parent, String name, Class<? extends com.badlogic.ashley.core.Component>... componentClasses) -
Archetype
@SafeVarargs 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
-