Game.Prefabs.LaneFlags
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: Enum
Base: System.Enum
Summary:
LaneFlags is a [Flags] enum used to describe properties and behaviors of a lane prefab (road/pedestrian/track/parking, etc.) in Cities: Skylines 2. Each value is a bitmask flag that can be combined to represent multiple characteristics for a single lane (for example a road lane that is two-way and allows parking). This enum is typically used when defining or inspecting lane prefabs and runtime lane state in mod code. Underlying type is int.
Fields
-
Invert = 1
Flag indicating the lane direction is inverted (logical direction reversed relative to default). -
Slave = 2
Marks the lane as a "slave" lane in a master/slave relationship (used when lanes are coupled/paired). -
Master = 4
Marks the lane as a "master" lane in a master/slave relationship. -
Road = 8
Designates the lane as a road lane (vehicle traffic). -
Pedestrian = 0x10 (16)
Designates the lane as a pedestrian lane/sidewalk. -
Parking = 0x20 (32)
Marks the lane as a parking lane. -
Track = 0x40 (64)
Designates the lane as a track (e.g., tram/rail) lane. -
Twoway = 0x80 (128)
Lane supports traffic in both directions. -
DisconnectedStart = 0x100 (256)
Lane is a disconnected start segment (not connected at one end). -
DisconnectedEnd = 0x200 (512)
Lane is a disconnected end segment (not connected at the other end). -
Secondary = 0x400 (1024)
A secondary lane (auxiliary/less-priority lane). -
Utility = 0x800 (2048)
Utility lane (could represent bike lane, service lane, etc., depending on game usage). -
Underground = 0x1000 (4096)
Lane is underground (tunnel). -
CrossRoad = 0x2000 (8192)
Lane is part of a crossroad/intersection-specific geometry. -
PublicOnly = 0x4000 (16384)
Lane reserved for public transport only. -
OnWater = 0x8000 (32768)
Lane exists on water (boat/water transport). -
Virtual = 0x10000 (65536)
Virtual lane used for pathfinding/logical routing (no physical lane geometry). -
FindAnchor = 0x20000 (131072)
Used for anchor-finding logic when laying out lanes/prefabs. -
LeftLimit = 0x40000 (262144)
Marks the left limit of a lane group (used for spacing/layout). -
RightLimit = 0x80000 (524288)
Marks the right limit of a lane group. -
ParkingLeft = 0x100000 (1048576)
Parking oriented/positioned to the left. -
ParkingRight = 0x200000 (2097152)
Parking oriented/positioned to the right. -
HasAuxiliary = 0x400000 (4194304)
Lane has auxiliary functionality (e.g., auxiliary lanes attached). -
EvenSpacing = 0x800000 (8388608)
Indicates lanes should be evenly spaced when laying out multiple lanes. -
PseudoRandom = 0x1000000 (16777216)
Flag used to enable pseudo-random behaviors where applicable (e.g., deterministic variation).
Properties
- None (this is a flags enum; no properties defined).
Note: use bitwise operations or Enum.HasFlag to inspect individual flags. For performance-critical code, prefer bitwise checks ((flags & LaneFlags.X) != 0).
Constructors
- None (enum type — default value is 0).
You create values by assigning single flags or bitwise combinations of flags.
Methods
- None (standard enum methods apply from System.Enum).
Usage Example
// Combine flags for a lane that is a road, two-way, and allows parking on the left
LaneFlags flags = LaneFlags.Road | LaneFlags.Twoway | LaneFlags.Parking | LaneFlags.ParkingLeft;
// Check whether this lane allows parking
bool allowsParking = (flags & LaneFlags.Parking) != 0;
// or (less performant): flags.HasFlag(LaneFlags.Parking)
// Add a flag (make it virtual)
flags |= LaneFlags.Virtual;
// Remove a flag (disable parking)
flags &= ~LaneFlags.Parking;
// Test for two-way
if ((flags & LaneFlags.Twoway) != 0) {
// handle two-way-specific logic
}
Notes:
- Because the enum is decorated with [Flags], values should be combined with bitwise operators.
- When working in performance-sensitive code (e.g., per-frame or per-lane loops), prefer bitwise operations over Enum.HasFlag.
- Cast to int if you need to store or serialize raw bitmask values.