Class ActorQuery<T extends IActor,Q extends ActorQuery<T,Q>>

Type Parameters:
T - the type of actor being queried (NPC or Player)
Q - the concrete query type (for method chaining)
All Implemented Interfaces:
Predicate<T>
Direct Known Subclasses:
NPCQuery, PlayerQuery

public abstract class ActorQuery<T extends IActor,Q extends ActorQuery<T,Q>> extends SceneEntityQuery<T,Q>
Abstract query class for filtering actors in the game world.

Actors are entities that can move, perform animations, and interact with other entities. This includes both NPCs and players. This class extends SceneEntityQuery with actor-specific filtering capabilities:

  • Combat levels
  • Animation IDs
  • Interaction targets
  • Movement state
  • Death state
  • Constructor Details

    • ActorQuery

      protected ActorQuery(Supplier<List<T>> supplier)
      Constructs a new actor query with the specified entity supplier.
      Parameters:
      supplier - a supplier that provides the list of actors to query
  • Method Details

    • levels

      public Q levels(int... levels)
      Filters actors by their combat levels.

      Only actors with a combat level matching one of the specified values will be included.

      Parameters:
      levels - the combat levels to filter by
      Returns:
      this query instance for method chaining
    • animations

      public Q animations(int... animations)
      Filters actors by their current animation.

      Only actors performing an animation matching one of the specified IDs will be included.

      Parameters:
      animations - the animation IDs to filter by
      Returns:
      this query instance for method chaining
    • targeting

      public Q targeting(Interactable... targets)
      Filters actors by their current interaction target.

      Only actors targeting one of the specified interactables will be included.

      Parameters:
      targets - the interaction targets to filter by
      Returns:
      this query instance for method chaining
    • targetless

      public Q targetless()
      Filters for actors that have no current target.

      Only actors that are not interacting with any entity will be included.

      Returns:
      this query instance for method chaining
    • moving

      public Q moving(Boolean moving)
      Filters actors by their movement state.

      Only actors whose movement state matches the specified value will be included.

      Parameters:
      moving - true to include only moving actors, false for stationary actors
      Returns:
      this query instance for method chaining
    • dead

      public Q dead(Boolean dead)
      Filters actors by their death state.

      Only actors whose death state matches the specified value will be included.

      Parameters:
      dead - true to include only dead actors, false for alive actors
      Returns:
      this query instance for method chaining
    • test

      public boolean test(T t)
      Tests whether an actor passes all accumulated filter criteria.

      This method checks the actor against all configured filters including combat level, animation, movement state, interaction target, and death state, in addition to the parent class filters.

      Specified by:
      test in interface Predicate<T extends IActor>
      Overrides:
      test in class SceneEntityQuery<T extends IActor,Q extends ActorQuery<T,Q>>
      Parameters:
      t - the actor to test
      Returns:
      true if the actor passes all filters, false otherwise