Skip to content

IEntityWorld.CreateCachedQuery() Method

Definition

Namespace: Brine2D.ECS

Creates a cached query builder for better performance when querying repeatedly.

C#
Brine2D.ECS.Query.CachedEntityQueryBuilder<T1> CreateCachedQuery<T1>()
    where T1 : Brine2D.ECS.Component;

Type parameters

T1

Returns

Brine2D.ECS.Query.CachedEntityQueryBuilder<T1>

Remarks

The CachedEntityQuery<T1> returned by .Build() registers itself with this world's invalidation index. Call Dispose() on it (typically inside protected override void Dispose(bool disposing) of the owning system) when the system is removed mid-scene. Failing to dispose leaves the query in the index until the world is disposed, preventing GC of the query and its cached result set.