Table of Contents

Class TierExtensions

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

Extension helpers for SimTier.

public static class TierExtensions
Inheritance
TierExtensions
Inherited Members

Fields

TierCount

Number of tier slots — fixed at 4 (Tier0 through Tier3).

public const int TierCount = 4

Field Value

int

Methods

IsSingleTier(SimTier)

True when tier has exactly one bit set.

public static bool IsSingleTier(this SimTier tier)

Parameters

tier SimTier

Returns

bool

TierCountOf(SimTier)

Number of tier bits set in tier.

public static int TierCountOf(this SimTier tier)

Parameters

tier SimTier

Returns

int

ToIndex(SimTier)

Map a single-bit SimTier flag to its 0-based array index (Tier0→0, Tier1→1, Tier2→2, Tier3→3).

public static int ToIndex(this SimTier tier)

Parameters

tier SimTier

Returns

int

Remarks

Undefined result when tier has zero or multiple bits set — callers must gate this method with IsSingleTier(SimTier). The implementation uses TrailingZeroCount(uint), which the JIT folds into a single TZCNT instruction on x86-64.