Game.EndFrameBarrier
Assembly:
Namespace:
Type:
Base:
Summary: The provided source file actually defines an enum Game.Net.TrafficLightState (not a type named EndFrameBarrier). Game.Net.TrafficLightState is a small byte-backed enum used to represent the state of a traffic light in Cities: Skylines 2 net/traffic code. It encodes the phase or transitional state of a traffic light controller (for example whether the light is currently ongoing or entering an extension). Typical usage is reading the enum to decide behavior, animations, or timing logic in net/traffic systems.
Defined members: - None — no active state / uninitialized. - Beginning — the start of a phase (phase just began). - Ongoing — phase is actively ongoing. - Ending — phase is ending / winding down. - Changing — transitioning between states (e.g., from green to yellow). - Extending — extension of current phase is in progress (e.g., added extra green time). - Extended — the phase has been extended (extension applied).
Assembly and exact semantics are inferred from name and members; consult runtime/engine docs or decompiled usage for precise behavioral semantics in a given game version.
Fields
-
private System.Diagnostics.Stopwatch m_Stopwatch
Not applicable to this file. The provided file defines an enum Game.Net.TrafficLightState and does not contain any Stopwatch fields. See Summary for the enum members and meanings. -
private Unity.Jobs.JobHandle <producerHandle>k__BackingField
Not applicable to this file. There are no JobHandle fields or auto-property backing fields in the enum. The file only contains the TrafficLightState enum (byte-backed).
Properties
public Unity.Jobs.JobHandle producerHandle { get; private set }
Not applicable. The enum contains no properties. Use the enum values directly to represent and compare traffic-light state.
Constructors
public EndFrameBarrier()
Not applicable. Enums do not define constructors in user code; TrafficLightState is an enum with underlying type byte. There is no explicit constructor to document here.
Methods
protected virtual OnCreate() : System.Void
Not applicable. The enum defines no methods. Behavior around traffic lights is implemented elsewhere in the codebase and will consume this enum.
Usage Example
[Preserve]
protected override void OnCreate()
{
base.OnCreate();
m_Stopwatch = new Stopwatch();
}
Additional, relevant example for Game.Net.TrafficLightState usage:
using Game.Net;
public void HandleTrafficLight(byte rawState)
{
// Cast from storage (byte) if needed
var state = (TrafficLightState)rawState;
switch (state)
{
case TrafficLightState.None:
// no action
break;
case TrafficLightState.Beginning:
// initialize timers/animations
break;
case TrafficLightState.Ongoing:
// normal behavior
break;
case TrafficLightState.Ending:
// prepare to switch next state
break;
case TrafficLightState.Changing:
// handle transitional behaviour (show yellow, play transition anim)
break;
case TrafficLightState.Extending:
// apply extension logic (e.g., add extra green time)
break;
case TrafficLightState.Extended:
// finalise extension state
break;
}
}
Notes for modders: - The enum is byte-backed (enum : byte). When storing or reading values from packed data or network messages, use byte storage to match the original type. - To find where the enum is consumed, search the codebase for references to TrafficLightState, TrafficLight, or net/traffic controllers — these will show the concrete semantics and timing logic. - Be careful when changing or extending the enum across multiple code components; binary compatibility matters if data is persisted or serialized.