Class EcsView<TArchetype>
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
HasChanges
True if any entities were added or removed since the last Refresh.
public bool HasChanges { get; }
Property Value
Removed
Entities that left the View since the last Refresh.
public IReadOnlyList<EntityId> Removed { get; }
Property Value
Methods
Contains(EntityId)
Test if an entity is currently in the View.
public bool Contains(EntityId id)
Parameters
idEntityId
Returns
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
txTransactionTransaction whose snapshot the view is refreshed against.
callerFilestringAuto-captured source file of the call site (diagnostics).
callerLineintAuto-captured source line of the call site (diagnostics).
callerMethodstringAuto-captured calling member name (diagnostics).
Exceptions
- ObjectDisposedException
The view has already been disposed.