Class EntityQuery

java.lang.Object
dev.prozilla.pine.core.entity.EntityQuery
All Implemented Interfaces:
Lifecycle

public class EntityQuery extends Object implements Lifecycle
Utility class for querying entities with specific components to be processed by a system.
  • Field Details Link icon

    • entityChunks Link icon

      public final ArrayList<EntityChunk> entityChunks
      List of entities that match this query.
    • isIterating Link icon

      public boolean isIterating
  • Constructor Details Link icon

    • EntityQuery Link icon

      public EntityQuery(Class<? extends Component>[] includedComponentTypes, Class<? extends Component>[] excludedComponentTypes, boolean disposable, String tag)
  • Method Details Link icon

    • destroy Link icon

      public void destroy()
      Removes all component groups.
      Specified by:
      destroy in interface Lifecycle
    • startIteration Link icon

      public void startIteration() throws IllegalStateException
      Throws:
      IllegalStateException
    • endIteration Link icon

      public void endIteration() throws IllegalStateException
      Throws:
      IllegalStateException
    • register Link icon

      public boolean register(Entity entity)
      Checks if an entity matches this query and if it does, adds the entity to the array of matches.
      Returns:
      True if the entity matches this query
    • unregister Link icon

      public boolean unregister(Entity entity)
      Unregisters an entity in this query.
      Parameters:
      entity - The entity
      Returns:
      True if this query was affected.
    • hasEntityChunks Link icon

      public boolean hasEntityChunks()
    • print Link icon

      public void print()
    • print Link icon

      public void print(Logger logger)