Table of Contents

Struct EcsQuery<TArchetype>.EcsQueryEnumerator

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

Streams the query's matches, yielding read-only EntityRefs; their component reads return copies. To write, open the entity with OpenMut(EntityId) or TryOpenMut(EntityId, out EntityRefMut).

public ref struct EcsQuery<TArchetype>.EcsQueryEnumerator
Inherited Members

Remarks

Each archetype's entity map is read in batches through a resumable cursor (RawValuePagedHashMap.EntryCursor): 64 keys first, then four times more per fill up to 4,096. Memory does not grow with the result, the first row costs one small fill, and a break costs what was filled. Between fills the walk holds no page. An entity present for the whole loop is visited exactly once, however the map splits meanwhile (EMAP-02).

What a row must pass is decided as it is filled, at the transaction's snapshot: visible, not destroyed by this transaction, enabled as the query requires. A destroy made inside the loop therefore hides a row not yet filled, and one already filled is skipped when it is reached. The transaction's own pending spawns come last: those made before the loop, never those made during it.

Properties

Current

The EntityRef resolved at the current position.

public EntityRef Current { get; }

Property Value

EntityRef

Methods

Dispose()

Gives back the batch and the cursor's bookkeeping; foreach calls it, on break too.

public void Dispose()

MoveNext()

Advances to the next matching entity, applying the WHERE post-filter; returns false at the end.

public bool MoveNext()

Returns

bool