Skip to content

Game.Vehicles.PoliceCarFlags

Assembly:
Namespace: Game.Vehicles

Type: enum (with [Flags])

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

Summary:
Flags enum used to represent the state and status bits for police vehicles. Each value is a single bit (uint) so multiple flags can be combined with bitwise operations. Common uses include testing whether a vehicle is returning, at its target, disembarking, full/empty, cancelled, disabled, or other shift-related states.


Fields

  • Returning = 1u
    Indicates the police car is returning (to base, to station, or to the dispatcher).

  • ShiftEnded = 2u
    Marks that the vehicle's shift has ended.

  • AccidentTarget = 4u
    The vehicle has an accident as its current target.

  • AtTarget = 8u
    Vehicle is at its intended target/destination.

  • Disembarking = 0x10u
    Vehicle is in the process of disembarking personnel (exiting the vehicle).

  • Cancelled = 0x20u
    The current mission/dispatch for the vehicle was cancelled.

  • Full = 0x40u
    Vehicle is full (e.g., personnel or capacity reached).

  • Empty = 0x80u
    Vehicle is empty.

  • EstimatedShiftEnd = 0x100u
    An estimated/anticipated shift end flag (used to mark planning/estimation).

  • Disabled = 0x200u
    Vehicle is disabled (out of service, broken down, or otherwise not active).

Note: There is no explicit "None" (0) member defined in this enum — value 0 represents "no flags set".

Properties

  • (none)
    This is a plain flags enum and does not define properties. Use bitwise operators to inspect or modify flags.

Constructors

  • (none)
    Enums do not define explicit constructors in source; the CLR manages instantiation and casting. You can cast numeric values to this enum type when needed.

Methods

  • (none)
    The enum itself doesn't define methods. Use standard enum/bitwise operations or helper/extension methods in your code.

Usage Example

// Combining flags
PoliceCarFlags flags = PoliceCarFlags.Returning | PoliceCarFlags.Full;

// Checking flags (fast bitwise check preferred over Enum.HasFlag)
bool isReturning = (flags & PoliceCarFlags.Returning) == PoliceCarFlags.Returning;
bool isFull = (flags & PoliceCarFlags.Full) == PoliceCarFlags.Full;

// Setting a flag
flags |= PoliceCarFlags.AtTarget;

// Clearing a flag
flags &= ~PoliceCarFlags.Returning;

// Toggling a flag
flags ^= PoliceCarFlags.Disembarking;

// Casting from/to underlying uint
uint raw = (uint)flags;
flags = (PoliceCarFlags)raw;

Additional notes for modders: - Because this enum is marked with [Flags], combine values with bitwise operators rather than creating separate variables. - Prefer the bitwise equality check ((flags & Flag) == Flag) over Enum.HasFlag for performance-critical code. - Be careful when modifying vehicle flags directly in game data — always use the game's provided APIs or proper threading/job synchronization to avoid race conditions or corrupting state.