Table of Contents

Struct Phase

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

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

name string

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

Phase

Input

The Input phase — runs first by default. Reserved for systems that ingest external commands or inputs.

public static readonly Phase Input

Field Value

Phase

Name

The phase name — used for equality, hashing, and diagnostic output.

public readonly string Name

Field Value

string

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

Phase

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

Phase

Methods

Equals(object)

Ordinal equality — true when obj is a Phase with an equal Name.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with.

Returns

bool

true when obj is an equal Phase.

Equals(Phase)

Ordinal equality on Name.

public bool Equals(Phase other)

Parameters

other Phase

The phase to compare with.

Returns

bool

true when 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

a Phase

Left operand.

b Phase

Right operand.

Returns

bool

true when the phases are equal.

operator !=(Phase, Phase)

Ordinal inequality operator — negation of Equals(Phase).

public static bool operator !=(Phase a, Phase b)

Parameters

a Phase

Left operand.

b Phase

Right operand.

Returns

bool

true when the phases differ.