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
tagstringThe string tag that must be present.
Returns
- IQueryBuilder
A query builder with the additional filter.
Exceptions
- ArgumentNullException
Thrown when
tagis null.- ArgumentException
Thrown when
tagis 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
TWithThe component type that must be present.
WithoutTag(string)
Excludes entities that have this string tag.
IQueryBuilder WithoutTag(string tag)
Parameters
tagstringThe string tag that must NOT be present.
Returns
- IQueryBuilder
A query builder with the additional filter.
Exceptions
- ArgumentNullException
Thrown when
tagis null.- ArgumentException
Thrown when
tagis 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
TWithoutThe component type that must NOT be present.