Skip to content

Game.Vehicles.PublicTransportFlags

Assembly: Assembly-CSharp
Namespace: Game.Vehicles

Type: public enum (Flags)

Base: System.Enum (underlying type: System.UInt32)

Summary:
Bitwise flags representing the various runtime states and conditions for public-transport vehicles in Cities: Skylines 2. These flags are used to record and test vehicle state (e.g., whether a vehicle is en route, boarding, full, disabled, etc.). Combine flags using bitwise operations or test them with HasFlag / bitwise & when inspecting or modifying vehicle state in mods.


Fields

  • Returning = 1u
    Flag indicating the vehicle is returning (e.g., returning to depot or origin).

  • EnRoute = 2u
    Vehicle is currently traveling along its route.

  • Boarding = 4u
    Passengers are boarding the vehicle.

  • Arriving = 8u
    Vehicle is arriving at a stop or station (approaching).

  • Launched = 0x10u
    Vehicle has been launched/spawned (used for vehicles that start or are deployed).

  • Evacuating = 0x20u
    Vehicle is in evacuation mode (used during disasters/emergencies).

  • PrisonerTransport = 0x40u
    Vehicle is being used for prisoner transport (special service).

  • RequiresMaintenance = 0x80u
    Vehicle requires maintenance and may need to visit a depot.

  • Refueling = 0x100u
    Vehicle is currently refueling.

  • AbandonRoute = 0x200u
    Vehicle is abandoning its scheduled route (e.g., due to blockage or error).

  • RouteSource = 0x400u
    Marks the vehicle as the source of a route (used internally for route handling).

  • Testing = 0x800u
    Vehicle is in testing mode (used for internal testing or preview behavior).

  • RequireStop = 0x1000u
    This vehicle requires a stop (flag indicating it must stop at the next stop).

  • DummyTraffic = 0x2000u
    Mark as dummy/non-player traffic (placeholder traffic used by simulation).

  • StopLeft = 0x4000u
    Indicates the vehicle will stop on the left side of the lane/road.

  • StopRight = 0x8000u
    Indicates the vehicle will stop on the right side of the lane/road.

  • Disabled = 0x10000u
    Vehicle is disabled/unusable (e.g., out of service).

  • Full = 0x20000u
    Vehicle has reached passenger capacity (is full).

Properties

  • None — this enum defines constant flags only; there are no instance properties on the enum type itself.

Constructors

  • None — enums are value types with an implicit default value of 0 (no flags set). You cannot define custom constructors for enums.

Methods

  • None declared on this type — standard System.Enum methods are available (ToString, HasFlag, etc.). Use bitwise operators to set, clear, or test flags, or use Enum.HasFlag for readability.

Usage Example

// Setting flags
PublicTransportFlags flags = PublicTransportFlags.EnRoute | PublicTransportFlags.RequireStop;

// Testing flags
bool isEnRoute = (flags & PublicTransportFlags.EnRoute) != 0;
// or
bool isFull = flags.HasFlag(PublicTransportFlags.Full);

// Adding a flag
flags |= PublicTransportFlags.Boarding;

// Removing a flag
flags &= ~PublicTransportFlags.RequireStop;

// Example: check and act
if ((flags & PublicTransportFlags.Disabled) != 0)
{
    // handle disabled vehicle (send to depot, mark for maintenance, etc.)
}