Class TierExtensions
Extension helpers for SimTier.
public static class TierExtensions
- Inheritance
-
TierExtensions
- Inherited Members
Fields
TierCount
public const int TierCount = 4
Field Value
Methods
IsSingleTier(SimTier)
True when tier has exactly one bit set.
public static bool IsSingleTier(this SimTier tier)
Parameters
tierSimTier
Returns
TierCountOf(SimTier)
Number of tier bits set in tier.
public static int TierCountOf(this SimTier tier)
Parameters
tierSimTier
Returns
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
tierSimTier
Returns
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.