Skip to content

Game.Events.VehicleLaunchFlags

Assembly:
Assembly-CSharp (runtime game code; may be located in the game's main assembly such as Assembly-CSharp.dll)

Namespace:
Game.Events

Type:
public enum (flags)

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

Summary:
VehicleLaunchFlags is a [Flags] enum used to represent the state(s) of a vehicle launch operation inside the game's event/vehicle systems. Because it is flagged, values can be combined (bitwise) to represent multiple simultaneous states, e.g., a vehicle that has requested a path and has been launched. The underlying storage is a 32-bit unsigned integer.


Fields

  • PathRequested = 1u
    Indicates that a path request for the vehicle has been made (the navigation/pathfinding for the vehicle was requested). This flag can be tested using bitwise operations or Enum.HasFlag.

  • Launched = 2u
    Indicates that the vehicle was launched/spawned (the launch action was performed). Can be combined with PathRequested to indicate both states.

Properties

  • None
    This enum does not declare properties. Use bitwise checks or Enum.HasFlag to query flags.

Constructors

  • None
    As an enum, there are no user-declared constructors. The default enum value (0) represents no flags set.

Methods

  • None (declared)
    No methods are declared on this enum type. Use standard Enum and bitwise operations to work with values:
  • Use (flags & VehicleLaunchFlags.PathRequested) != 0 to test a flag.
  • Use flags.HasFlag(VehicleLaunchFlags.Launched) for a readable test (note: HasFlag is slower than bitwise on performance-critical code).
  • Use bitwise OR (|) to combine flags and bitwise AND with complement to clear flags.

Usage Example

// Create a flags value indicating both a path request and that the vehicle was launched
VehicleLaunchFlags flags = VehicleLaunchFlags.PathRequested | VehicleLaunchFlags.Launched;

// Test for a specific flag (bitwise, recommended for performance)
bool requested = (flags & VehicleLaunchFlags.PathRequested) != 0;

// Test using HasFlag (clearer, slightly slower)
bool launched = flags.HasFlag(VehicleLaunchFlags.Launched);

// Set a flag
flags |= VehicleLaunchFlags.Launched;

// Clear a flag
flags &= ~VehicleLaunchFlags.PathRequested;

Additional notes: - Because the enum uses an unsigned 32-bit underlying type, you can safely add more distinct flags up to 31 usable bits (excluding zero). - Prefer bitwise checks in hot paths (e.g., per-frame code) for better performance; HasFlag is fine for less performance-sensitive logic.