Skip to content

Game.Net.PedestrianLaneFlags

Assembly: Assembly-CSharp
Namespace: Game.Net

Type: public enum

Base: System.Enum

Summary: Flags enum describing characteristics and behaviors of a pedestrian lane in Cities: Skylines 2. Marked with [Flags], values can be combined with bitwise operations to represent multiple attributes at once (for example a lane can be both a Crosswalk and AllowEnter). Use these flags when reading or setting lane data related to pedestrian routing, connectivity, and special conditions.


Fields

  • Unsafe = 1
    Used to mark a pedestrian lane as unsafe. Typically indicates the lane should be treated with caution in pathfinding or AI decisions (for example, reduced preference or higher cost).

  • Crosswalk = 2
    Indicates the lane is a crosswalk. Crosswalk lanes are treated differently by pedestrian AI (e.g., prefer for crossing streets) and may interact with traffic rules and signals.

  • AllowMiddle = 4
    Allows pedestrians to use the middle position of the lane. Useful for wide lanes or special geometry where middle traversal is permitted.

  • AllowEnter = 8
    Permits pedestrians to enter this lane from other lanes or connections (i.e., the lane can be a target for lane-entering behavior).

  • SideConnection = 0x10
    Marks a side connection. Typically used when the lane connects to sidewalks, building entrances, or other side attachments rather than through traffic.

  • ForbidTransitTraffic = 0x20
    Prevents transit vehicles or transit-related traffic from using this lane. Relevant when lanes are adjacent to or interact with transit systems.

  • OnWater = 0x40
    Indicates the lane is on water (e.g., a pedestrian path on a ferry or boat). Affects which pathfinding and movement rules apply.

  • AllowExit = 0x80
    Permits pedestrians to exit the lane to other lanes or tiles (i.e., the lane can be a source for lane-exiting behavior).

Properties

  • None (enum type; no properties)

{{ The enum is decorated with [Flags], so treat values as bit flags that can be combined. Use bitwise operators to query and modify flags. }}

Constructors

  • None (enum type has no constructors)

{{ Enumerations don't have explicit constructors. Values are plain integral constants that can be combined at runtime. }}

Methods

  • None (enum type; no methods)

{{ Use C# bitwise operations to work with these flags (see usage examples below). }}

Usage Example

// Combine flags when assigning
PedestrianLaneFlags flags = PedestrianLaneFlags.Crosswalk | PedestrianLaneFlags.AllowEnter;

// Check if a specific flag is set
bool isCrosswalk = (flags & PedestrianLaneFlags.Crosswalk) != 0;

// Add a flag
flags |= PedestrianLaneFlags.AllowExit;

// Remove a flag
flags &= ~PedestrianLaneFlags.AllowEnter;

// Toggle a flag
flags ^= PedestrianLaneFlags.Unsafe;

// Example helper methods
static bool HasFlag(PedestrianLaneFlags value, PedestrianLaneFlags flag) {
    return (value & flag) != 0;
}

static PedestrianLaneFlags SetFlag(PedestrianLaneFlags value, PedestrianLaneFlags flag) {
    return value | flag;
}

static PedestrianLaneFlags ClearFlag(PedestrianLaneFlags value, PedestrianLaneFlags flag) {
    return value & ~flag;
}

{{ YOUR_INFO }}