Table of Contents

Interface IQueryBuilder

Namespace
KeenEyes
Assembly
KeenEyes.Abstractions.dll

Interface for fluent query building.

public interface IQueryBuilder : IEnumerable<Entity>, IEnumerable
Inherited Members

Methods

Count()

Counts the number of entities matching this query.

int Count()

Returns

int

The number of entities matching the query.

Remarks

This method is optimized to avoid LINQ overhead and is safe to use in hot paths. When no string tag filters are applied, it sums archetype counts directly (O(archetypes)). When string tag filters are present, it must iterate entities (O(entities)).

WithTag(string)

Requires the entity to have this string tag.

IQueryBuilder WithTag(string tag)

Parameters

tag string

The string tag that must be present.

Returns

IQueryBuilder

A query builder with the additional filter.

Exceptions

ArgumentNullException

Thrown when tag is null.

ArgumentException

Thrown when tag is empty or whitespace.

With<TWith>()

Requires the entity to have this component (filter only, not accessed).

IQueryBuilder With<TWith>() where TWith : struct, IComponent

Returns

IQueryBuilder

A query builder with the additional filter.

Type Parameters

TWith

The component type that must be present.

WithoutTag(string)

Excludes entities that have this string tag.

IQueryBuilder WithoutTag(string tag)

Parameters

tag string

The string tag that must NOT be present.

Returns

IQueryBuilder

A query builder with the additional filter.

Exceptions

ArgumentNullException

Thrown when tag is null.

ArgumentException

Thrown when tag is empty or whitespace.

Without<TWithout>()

Excludes entities that have this component.

IQueryBuilder Without<TWithout>() where TWithout : struct, IComponent

Returns

IQueryBuilder

A query builder with the additional filter.

Type Parameters

TWithout

The component type that must NOT be present.