Class AndQuery<ECS_TYPE>

java.lang.Object
com.hypixel.hytale.component.query.AndQuery<ECS_TYPE>
Type Parameters:
ECS_TYPE - The type of the ECS.
All Implemented Interfaces:
Query<ECS_TYPE>

public class AndQuery<ECS_TYPE> extends Object implements Query<ECS_TYPE>
A query type that matches if all of the provided queries match.
  • Constructor Details

    • AndQuery

      @SafeVarargs public AndQuery(@Nonnull Query<ECS_TYPE>... queries)
      Default Constructor for an AndQuery instance.
      Parameters:
      queries - The array of queries to match against.
  • Method Details

    • test

      public boolean test(Archetype<ECS_TYPE> archetype)
      Description copied from interface: Query
      Controls if this query should process the provided Archetype.
      Specified by:
      test in interface Query<ECS_TYPE>
      Returns:
      true if the archetype should be processed by this query.
    • requiresComponentType

      public boolean requiresComponentType(ComponentType<ECS_TYPE,?> componentType)
      Description copied from interface: Query
      Controls if a query requires a component and so if used by a system it should be automatically unregistered if a component type is removed.
      Specified by:
      requiresComponentType in interface Query<ECS_TYPE>
      Returns:
      true if the componentType is required.
    • validateRegistry

      public void validateRegistry(@Nonnull ComponentRegistry<ECS_TYPE> registry)
      Description copied from interface: Query
      Validates that the provided ComponentRegistry is compatible with this query.
      Specified by:
      validateRegistry in interface Query<ECS_TYPE>
      Parameters:
      registry - The component registry to validate against.
    • validate

      public void validate()
      Description copied from interface: Query
      Validates the internal state of this query.
      Specified by:
      validate in interface Query<ECS_TYPE>