Table of Contents

Class EcsView<TArchetype>

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

Reactive ECS View with incremental refresh via Typhon.Engine.Internals.ViewDeltaRingBuffer. Inherits ViewBase for entity set management, delta tracking, and ring buffer lifecycle. When FieldEvaluators are present (Expression-based WHERE), registers with Typhon.Engine.Internals.ViewRegistry for push-based delta notifications. Otherwise, falls back to pull-model (full re-query on each Refresh).

public class EcsView<TArchetype> : ViewBase, IView, IDisposable, IEnumerable<long>, IEnumerable where TArchetype : class

Type Parameters

TArchetype
Inheritance
EcsView<TArchetype>
Implements
Inherited Members

Properties

Added

Entities that entered the View since the last Refresh.

public IReadOnlyList<EntityId> Added { get; }

Property Value

IReadOnlyList<EntityId>

HasChanges

True if any entities were added or removed since the last Refresh.

public bool HasChanges { get; }

Property Value

bool

Removed

Entities that left the View since the last Refresh.

public IReadOnlyList<EntityId> Removed { get; }

Property Value

IReadOnlyList<EntityId>

Methods

Contains(EntityId)

Test if an entity is currently in the View.

public bool Contains(EntityId id)

Parameters

id EntityId

Returns

bool

DeregisterFromRegistries()

Removes this view from its query registry so it stops receiving change notifications; invoked during teardown.

protected override void DeregisterFromRegistries()

GetEntityEnumerator()

Iterate EntityIds in the view.

public EcsView<TArchetype>.EntityIdEnumerator GetEntityEnumerator()

Returns

EcsView<TArchetype>.EntityIdEnumerator

Refresh(Transaction, string, int, string)

Recomputes the view's membership against tx's snapshot; the Added and Removed collections reflect the changes since the previous refresh. The caller-info parameters are captured automatically for diagnostics and should not be supplied explicitly.

public override void Refresh(Transaction tx, string callerFile = null, int callerLine = 0, string callerMethod = null)

Parameters

tx Transaction

Transaction whose snapshot the view is refreshed against.

callerFile string

Auto-captured source file of the call site (diagnostics).

callerLine int

Auto-captured source line of the call site (diagnostics).

callerMethod string

Auto-captured calling member name (diagnostics).

Exceptions

ObjectDisposedException

The view has already been disposed.