CachedEntityQueryBase Class
Abstract base for cached entity queries. Holds shared state (world, options, filters) and implements invalidation, disposal, and filter matching once for all arities.
public abstract class CachedEntityQueryBase : System.IDisposable
Inheritance System.Object → CachedEntityQueryBase
Derived
↳ CachedEntityQuery<T1,T2,T3,T4>
↳ CachedEntityQuery<T1,T2,T3>
↳ CachedEntityQuery<T1,T2>
↳ CachedEntityQuery<T1>
Implements System.IDisposable
| Properties | |
|---|---|
| ComponentTypes | The component types this query tracks for invalidation. Includes both required and excluded types so that adding or removing an excluded component correctly triggers a cache rebuild. |
| FiltersActiveState | Whether this query filters by entity active state (default true). Queries built with IncludeInactive() return false and are skipped when only IsActive changes. |
| FiltersEnabledState | Whether this query filters by component enabled state. Queries built with OnlyEnabled() return true and are invalidated when any IsEnabled changes. |
| HasBehaviorFilters | Whether this query filters by behaviors. Used by EntityWorld to target behavior-change invalidation. |
| HasTagFilters | Whether this query filters by entity tags. Used by EntityWorld to target tag-change invalidation. |
| TagFilters | All tag strings this query filters by (with-all, without, any-of). Used by EntityWorld for per-tag invalidation targeting. |
| Methods | |
|---|---|
| Count() | Gets the cached count, refreshing the cache if dirty. |
| Dispose() | Unregisters this query from the world's invalidation index. Call when the owning system is removed mid-scene. Failing to dispose leaves the query in the world's invalidation index, preventing GC until the world itself is disposed. |
| EnsureCache() | Rebuilds the cache if dirty. |
| Invalidate() | Forces the cache to refresh on the next execution. |
| ThrowIfDisposed() | Throws System.ObjectDisposedException if this query has been disposed. Called by EnsureCache() in each concrete arity to prevent silent use of a query that no longer receives invalidation notifications. |