Skip to content

Game.Events.AccidentSiteFlags

Assembly:
Assembly-CSharp (game assembly)

Namespace: Game.Events

Type: public enum AccidentSiteFlags : uint

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

Summary: AccidentSiteFlags is a bitmask-style enumeration (marked with [Flags]) used to represent the state and characteristics of an accident site / incident in the game. Individual flags can be combined using bitwise operations to represent multiple aspects of a single accident site (for example: whether it is secured, requires police, is a crime scene, etc.). This enum is useful for mods that read, set, or synchronize incident state, influence AI responses, or change UI/behavior based on incident attributes.


Fields

  • StageAccident = 1u Flag indicating the site is in an accident staging state (an accident event is currently staged or ongoing).

  • Secured = 2u Indicates the site has been secured (e.g., emergency services have cordoned off the area).

  • CrimeScene = 4u Marks the site as a crime scene (used by police/crime systems).

  • TrafficAccident = 8u Specifies the incident is a traffic accident (as opposed to other incident types).

  • CrimeFinished = 0x10u Indicates a crime-related incident has been completed/closed.

  • CrimeDetected = 0x20u Flag set when a crime has been detected at the site (detection stage).

  • CrimeMonitored = 0x40u Indicates the crime or site is under police monitoring or surveillance.

  • RequirePolice = 0x80u Marks the incident as requiring police response.

  • MovingVehicles = 0x100u Indicates vehicles involved are moving (not stationary), which can affect clearing logic or response behavior.

Properties

  • None. This is a simple enum used as a bitmask; there are no custom properties defined on it.

Constructors

  • None. Enums do not declare constructors; values are assigned as constants.

Methods

  • None declared on this enum. Use standard System.Enum methods and bitwise operations. Common operations:
  • Use HasFlag (flags.HasFlag(AccidentSiteFlags.Secured)) to test flags.
  • Use bitwise OR (|) to combine flags, AND (&) to test/clear, and XOR (^) to toggle.
  • Cast to/from uint when storing or transmitting the raw value.

Usage Example

// Combine flags when creating/updating an accident site
AccidentSiteFlags flags = AccidentSiteFlags.StageAccident | AccidentSiteFlags.RequirePolice;

// Test for a specific flag
if (flags.HasFlag(AccidentSiteFlags.RequirePolice))
{
    // Trigger police responder logic
}

// Add a flag (mark the site as secured)
flags |= AccidentSiteFlags.Secured;

// Remove a flag (clear the staged accident state)
flags &= ~AccidentSiteFlags.StageAccident;

// Toggle a flag
flags ^= AccidentSiteFlags.CrimeMonitored;

// Store or transmit as raw uint
uint raw = (uint)flags;
AccidentSiteFlags readBack = (AccidentSiteFlags)raw;