Class SystemBuilder<TContext>
Typed fluent builder for systems deriving from ChunkedCallbackSystem<TContext>. Wraps a non-generic SystemBuilder and exposes typed ShouldRun(Func<TContext, bool>) / Prepare(Func<TContext, int>) overloads that receive the ambient TContext. All other methods forward to the inner builder unchanged.
public sealed class SystemBuilder<TContext> where TContext : class
Type Parameters
TContext
- Inheritance
-
SystemBuilder<TContext>
- Inherited Members
Methods
AdditionalReads<T>()
Declares a read of T beyond the system's primary View input (cross-entity read).
public SystemBuilder<TContext> AdditionalReads<T>() where T : unmanaged
Returns
- SystemBuilder<TContext>
Type Parameters
T
After(string)
Declares a dependency on another system (this system runs after it).
public SystemBuilder<TContext> After(string dependency)
Parameters
dependencystring
Returns
- SystemBuilder<TContext>
AfterAll(params string[])
Declares dependencies on multiple systems (this system runs after all of them).
public SystemBuilder<TContext> AfterAll(params string[] dependencies)
Parameters
dependenciesstring[]
Returns
- SystemBuilder<TContext>
Before(string)
Declares that this system must run before another (mirror of After(string)).
public SystemBuilder<TContext> Before(string dependent)
Parameters
dependentstring
Returns
- SystemBuilder<TContext>
CanShed(bool)
Sets whether this system can be shed entirely under severe overload.
public SystemBuilder<TContext> CanShed(bool value)
Parameters
valuebool
Returns
- SystemBuilder<TContext>
CellAmortize(int)
Sets the cell-level amortization denominator — the system processes 1/N of the tier's clusters per tick. Requires a non-All tier.
public SystemBuilder<TContext> CellAmortize(int denominator)
Parameters
denominatorint
Returns
- SystemBuilder<TContext>
ChangeFilter(params Type[])
Sets the component types for change-filtered reactive input. OR logic: entity included if any filtered component was written.
public SystemBuilder<TContext> ChangeFilter(params Type[] componentTypes)
Parameters
componentTypesType[]
Returns
- SystemBuilder<TContext>
Checkerboard()
Enables two-phase checkerboard dispatch — no two adjacent cells are processed simultaneously. Requires Parallel().
public SystemBuilder<TContext> Checkerboard()
Returns
- SystemBuilder<TContext>
ChunkedParallel(int)
Enables chunk-parallel execution for a chunked callback with an explicit chunk count, independent of any entity input.
public SystemBuilder<TContext> ChunkedParallel(int chunkCount)
Parameters
chunkCountint
Returns
- SystemBuilder<TContext>
ChunksPerWorker(float)
Sets the oversubscription factor for parallel chunk dispatch (worker cap becomes round(WorkerCount × factor)). Must be in [1.0, 64.0].
public SystemBuilder<TContext> ChunksPerWorker(float factor)
Parameters
factorfloat
Returns
- SystemBuilder<TContext>
ExclusivePhase()
Marks this system as having exclusive control of its phase — no other system in the same phase may run concurrently.
public SystemBuilder<TContext> ExclusivePhase()
Returns
- SystemBuilder<TContext>
Input(Func<ViewBase>)
Sets the View factory providing the system's entity input.
public SystemBuilder<TContext> Input(Func<ViewBase> viewFactory)
Parameters
Returns
- SystemBuilder<TContext>
Name(string)
Sets the system's unique name in the DAG.
public SystemBuilder<TContext> Name(string name)
Parameters
namestring
Returns
- SystemBuilder<TContext>
Parallel()
Enables automatic chunk-parallel execution across workers. QuerySystem only.
public SystemBuilder<TContext> Parallel()
Returns
- SystemBuilder<TContext>
Phase(Phase)
Assigns this system to a phase. The phase must be one declared on the owning DAG.
public SystemBuilder<TContext> Phase(Phase phase)
Parameters
phasePhase
Returns
- SystemBuilder<TContext>
Prepare(Func<TContext, int>)
Set a typed plan builder evaluated before dispatch. Returns the dynamic chunk count (0 = skip, >0 = dispatch, -1 = no opinion).
public SystemBuilder<TContext> Prepare(Func<TContext, int> planBuilder)
Parameters
Returns
- SystemBuilder<TContext>
Priority(SystemPriority)
Sets the system's overload priority.
public SystemBuilder<TContext> Priority(SystemPriority priority)
Parameters
prioritySystemPriority
Returns
- SystemBuilder<TContext>
ReadsEvents(EventQueueBase)
Declares that this system consumes from the given event queue.
public SystemBuilder<TContext> ReadsEvents(EventQueueBase queue)
Parameters
queueEventQueueBase
Returns
- SystemBuilder<TContext>
ReadsFresh<T>()
Declares a read of T ordered after any same-phase writer of it. See ReadsFresh<T>().
public SystemBuilder<TContext> ReadsFresh<T>() where T : unmanaged
Returns
- SystemBuilder<TContext>
Type Parameters
T
ReadsResource(string)
Declares that this system reads a named resource.
public SystemBuilder<TContext> ReadsResource(string name)
Parameters
namestring
Returns
- SystemBuilder<TContext>
ReadsSnapshot<T>()
Declares a read of T ordered before any same-phase writer of it. See ReadsSnapshot<T>().
public SystemBuilder<TContext> ReadsSnapshot<T>() where T : unmanaged
Returns
- SystemBuilder<TContext>
Type Parameters
T
Reads<T>()
Declares that this system reads component T. See Reads<T>().
public SystemBuilder<TContext> Reads<T>() where T : unmanaged
Returns
- SystemBuilder<TContext>
Type Parameters
T
ShouldRun(Func<TContext, bool>)
Set a typed predicate evaluated before dispatch. Stored on the system instance; read by Typhon.Engine.ChunkedCallbackSystem<TContext>.OnShouldRun().
public SystemBuilder<TContext> ShouldRun(Func<TContext, bool> predicate)
Parameters
Returns
- SystemBuilder<TContext>
SideWrites<T>()
Declares that this system writes T via a side-transaction. Surfaced in tooling but does NOT affect scheduler ordering.
public SystemBuilder<TContext> SideWrites<T>() where T : unmanaged
Returns
- SystemBuilder<TContext>
Type Parameters
T
ThrottledTickDivisor(int)
Sets the throttled tick divisor (system runs every Nth tick under overload).
public SystemBuilder<TContext> ThrottledTickDivisor(int divisor)
Parameters
divisorint
Returns
- SystemBuilder<TContext>
TickDivisor(int)
Sets the tick divisor (system runs every Nth tick at normal load).
public SystemBuilder<TContext> TickDivisor(int divisor)
Parameters
divisorint
Returns
- SystemBuilder<TContext>
Tier(SimTier)
Sets the simulation-tier dispatch filter (this system only processes clusters whose cell matches the tier).
public SystemBuilder<TContext> Tier(SimTier tier)
Parameters
tierSimTier
Returns
- SystemBuilder<TContext>
WritesEvents(EventQueueBase)
Declares that this system publishes to the given event queue.
public SystemBuilder<TContext> WritesEvents(EventQueueBase queue)
Parameters
queueEventQueueBase
Returns
- SystemBuilder<TContext>
WritesResource(string)
Declares that this system mutates a named resource (e.g., a shared physics-world handle that isn't a component).
public SystemBuilder<TContext> WritesResource(string name)
Parameters
namestring
Returns
- SystemBuilder<TContext>
WritesVersioned()
Declares that this parallel QuerySystem writes Versioned components. Forces per-chunk Transaction fallback instead of the PointInTimeAccessor path.
public SystemBuilder<TContext> WritesVersioned()
Returns
- SystemBuilder<TContext>
Writes<T>()
Declares that this system mutates component T. See Writes<T>().
public SystemBuilder<TContext> Writes<T>() where T : unmanaged
Returns
- SystemBuilder<TContext>
Type Parameters
T