Struct Phase
A phase token in the system scheduler. Phases form a DAG-local total order (see RFC 07 / Q3) — every system belongs to a phase of its DAG, and all systems in phase N complete before any system in phase N+1 of the same DAG.
public readonly struct Phase : IEquatable<Phase>
- Implements
- Inherited Members
Remarks
Typhon ships four reusable phase tokens via static fields: Input, Simulation, Output, Cleanup. A DAG declares its ordered phase sequence via Phases(params Phase[]); user code may reuse these tokens or declare its own.
The token wraps a string for diagnostic clarity and minimal memory footprint — phases are resolved to integer indices once at Build(IResource, ILogger) time, after which the runtime uses the int form everywhere.
Constructors
Phase(string)
Constructs a phase token. Prefer the static fields (Input, etc.) or define your own statics.
public Phase(string name)
Parameters
namestring
Fields
Cleanup
The Cleanup phase — runs last by default. Reserved for systems that finalise tick state (archetype cleanup, index updates, etc.).
public static readonly Phase Cleanup
Field Value
Input
The Input phase — runs first by default. Reserved for systems that ingest external commands or inputs.
public static readonly Phase Input
Field Value
Name
The phase name — used for equality, hashing, and diagnostic output.
public readonly string Name
Field Value
Output
The Output phase — runs after Simulation by default. Reserved for systems that emit data downstream (rendering, network, persistence).
public static readonly Phase Output
Field Value
Simulation
The Simulation phase — runs after Input by default. Reserved for the bulk of game-logic / simulation systems.
public static readonly Phase Simulation
Field Value
Methods
Equals(object)
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with.
Returns
Equals(Phase)
Ordinal equality on Name.
public bool Equals(Phase other)
Parameters
otherPhaseThe phase to compare with.
Returns
- bool
truewhen both names are ordinally equal.
GetHashCode()
Ordinal hash of Name; 0 when the name is null.
public override int GetHashCode()
Returns
- int
The hash code.
ToString()
The phase Name, or "<unset>" when the name is null.
public override string ToString()
Returns
- string
The phase name, for diagnostic output.
Operators
operator ==(Phase, Phase)
Ordinal equality operator — see Equals(Phase).
public static bool operator ==(Phase a, Phase b)
Parameters
Returns
- bool
truewhen the phases are equal.
operator !=(Phase, Phase)
Ordinal inequality operator — negation of Equals(Phase).
public static bool operator !=(Phase a, Phase b)
Parameters
Returns
- bool
truewhen the phases differ.