Game.Vehicles.TrainLaneFlags
Assembly:
Assembly-CSharp.dll
Namespace:
Game.Vehicles
Type:
public enum (with [Flags] attribute)
Base:
System.Enum (underlying type: System.UInt32)
Summary:
Bit flags used by the train/rail vehicle code to represent per-lane states, behaviors and reservation/status markers. These flags are combined with bitwise operations to indicate things like end-of-path, turning intent, reservation modes (try/reserve/full), special lane behaviour (keep clear, parking space), and a few status markers used by the vehicle/pathing logic.
Fields
-
EndOfPath = 1u
Marks that the lane is at the end of the path (0x00000001). Typically used to identify final segment/stop conditions. -
EndReached = 2u
Indicates that the vehicle has reached the end point (0x00000002). -
Return = 4u
Signifies a return trip or that the vehicle should return (0x00000004). -
PushBlockers = 8u
Allows pushing/blocking behavior for obstructing units (0x00000008). -
ResetSpeed = 0x10u
Indicates a reset speed behavior or command (0x00000010). -
HighBeams = 0x20u
Toggles high beams/headlights on the vehicle (0x00000020). -
Obsolete = 0x40u
Flag marked as obsolete (0x00000040). Kept for compatibility. -
Reserved = 0x80u
A reserved flag for internal/forward-compatible use (0x00000080). -
TurnLeft = 0x100u
Marks that the lane/vehicle intends to turn left (0x00000100). -
TurnRight = 0x200u
Marks that the lane/vehicle intends to turn right (0x00000200). -
BlockReserve = 0x400u
Blocks reservation on the lane (0x00000400). -
ParkingSpace = 0x800u
Indicates a parking space or parking-related lane (0x00000800). -
KeepClear = 0x4000u
Keep-clear zone behaviour (0x00004000). Used to prevent blocking an area. -
TryReserve = 0x8000u
Attempt-only reservation flag (try to reserve the lane) (0x00008000). -
Connection = 0x10000u
Indicates a connection-type lane/segment (0x00010000). -
Exclusive = 0x20000u
Exclusive reservation (exclusive use of the lane) (0x00020000). -
FullReserve = 0x40000u
Full reservation (stronger reservation semantics) (0x00040000).
Properties
- None — this type is an enum and does not define properties. Standard Enum methods (Enum.ToString, HasFlag via System.Enum, etc.) are available.
Constructors
- None — enums do not declare constructors in user code. Values are assigned as constants.
Methods
- None declared on the enum type itself. Use standard Enum utilities and bitwise operations. Example helpers commonly used:
- flags.HasFlag(TrainLaneFlags.TryReserve)
- (flags & TrainLaneFlags.TryReserve) != 0
- (TrainLaneFlags)((uint)flags | (uint)TrainLaneFlags.FullReserve)
Usage Example
// Combine flags
TrainLaneFlags flags = TrainLaneFlags.TurnLeft | TrainLaneFlags.TryReserve;
// Check a flag (preferred bitwise check for performance)
if ((flags & TrainLaneFlags.TryReserve) != 0)
{
// attempt reservation logic
}
// Or use HasFlag (slower due to boxing prior to .NET improvements)
if (flags.HasFlag(TrainLaneFlags.TurnLeft))
{
// handle left turn behavior
}
// Add/remove flags
flags |= TrainLaneFlags.KeepClear; // add
flags &= ~TrainLaneFlags.TryReserve; // remove
// Get raw underlying value
uint rawValue = (uint)flags;