Game.Vehicles.CarLaneFlags
Assembly: Assembly-CSharp
Namespace: Game.Vehicles
Type: public enum (with [Flags] attribute)
Base: System.UInt32
Summary:
CarLaneFlags is a bitmask-style enumeration used by the vehicle/lane systems to represent per-lane and per-vehicle state flags for car AI and pathfinding. Each enum value is a distinct power-of-two mask so multiple flags can be combined to represent complex states such as lane reservations, turn intentions, blocking, queueing, and special behaviours (roundabouts, reversing, parking, etc.). This enum is typically used when evaluating lane suitability, tracking vehicle progress, or marking temporary lane/vehicle conditions during simulation steps.
Fields
-
EndOfPath = 1u
Marks that the end of the path (final segment/node) has been reached or is targeted. -
EndReached = 2u
Indicates the vehicle has reached its final destination or the expected path end. -
UpdateOptimalLane = 4u
Request/update flag to re-evaluate or update the optimal lane choice for a vehicle. -
TransformTarget = 8u
Used when the lane or vehicle is targeting a specific transform/target (e.g., for a maneuver or anchor). -
ParkingSpace = 0x10u
Indicates assignment to or targeting of a parking space. -
EnteringRoad = 0x20u
Vehicle is in the process of entering a new road (transition state). -
Obsolete = 0x40u
Marked as obsolete — typically used to indicate the flag/state should no longer be considered. -
Reserved = 0x80u
Lane or slot is reserved (for example, reserved for a particular vehicle or action). -
FixedLane = 0x100u
Vehicle is fixed to a specific lane and should not change lanes. -
Waypoint = 0x200u
Represents a waypoint-related state (intermediate target along the route). -
Checked = 0x400u
Mark used when a lane/state has already been checked during an evaluation pass. -
GroupTarget = 0x800u
Targeting as part of a vehicle group or convoy behavior. -
Queue = 0x1000u
The vehicle is queued (e.g., waiting in a junction, parking queue or entry queue). -
IgnoreBlocker = 0x2000u
Vehicle/lane should ignore a blocker in front (used for special cases like forced movement). -
IsBlocked = 0x4000u
Lane or vehicle is blocked (cannot proceed due to an obstruction). -
QueueReached = 0x8000u
The queued position has been reached. -
Validated = 0x10000u
Path/lane/state has been validated (passed checks). -
Interruption = 0x20000u
Indicates an interruption occurred (e.g., to pathing or movement). -
TurnLeft = 0x40000u
Intent to turn left at the next junction. -
TurnRight = 0x80000u
Intent to turn right at the next junction. -
PushBlockers = 0x100000u
Indicates behavior that may push or displace blockers (rare/special-case behavior). -
HighBeams = 0x200000u
Visual/lighting flag (e.g., high beams on) — can be used for visual state or AI signalling. -
RequestSpace = 0x400000u
Vehicle is requesting space ahead (common in intersection/lane reservation logic). -
FixedStart = 0x800000u
Start position/lane is fixed and should not be changed. -
Connection = 0x1000000u
Related to a connection state (e.g., lane/segment connection). -
ResetSpeed = 0x2000000u
Indicates speed should be reset (e.g., after some maneuver or interruption). -
Area = 0x4000000u
Related to an area flag (used when a lane or vehicle is within a special area). -
Roundabout = 0x8000000u
Vehicle is inside or dealing with a roundabout-specific state. -
CanReverse = 0x10000000u
Vehicle is allowed/capable of reversing in current context. -
ClearedForPathfind = 0x20000000u
Flag indicating the lane/vehicle has been cleared/prepared for pathfinding.
Properties
- This enum defines no properties. It is a pure bitmask (constant values) used directly where flags are required.
Constructors
- Enums do not have explicit constructors in typical usage. The underlying type (uint) is used to store the combined flags.
Methods
- This enum defines no instance methods. Typical usage relies on bitwise operations to test, set, or clear flags.
Usage Example
using Game.Vehicles;
public void ProcessLane(uint laneFlagsValue)
{
CarLaneFlags flags = (CarLaneFlags)laneFlagsValue;
// Check for turn intentions
if ((flags & CarLaneFlags.TurnLeft) != 0)
{
// handle left-turn behavior
}
// Combine flags
CarLaneFlags newFlags = CarLaneFlags.Queue | CarLaneFlags.IsBlocked;
// Set a flag
flags |= CarLaneFlags.Checked;
// Clear a flag
flags &= ~CarLaneFlags.RequestSpace;
// Test for multiple flags
bool isQueuedAndBlocked = (flags & (CarLaneFlags.Queue | CarLaneFlags.IsBlocked)) != 0;
}
Notes: - Because the enum has the [Flags] attribute, bitwise operators should be used to combine and test multiple states. - When reading or writing these flags in the game simulation, ensure atomicity / appropriate synchronization if modifying shared data structures in multithreaded contexts.