Skip to content

Game.Vehicles.AircraftFlags

Assembly: Assembly-CSharp
Namespace: Game.Vehicles

Type: enum (with [Flags] attribute)

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

Summary:
AircraftFlags is a bitmask enum used by the vehicle/aircraft simulation to represent multiple boolean states and behaviors for aircraft in the game. The [Flags] attribute allows combinations of values to be stored in a single uint. Typical uses include altering AI behavior (e.g., keeping an aircraft on taxiways, marking emergency status), controlling collision/parking interactions, and optimizing state checks in vehicle logic. Values are intended to be combined with bitwise operations or checked with Enum.HasFlag / bitwise &.


Fields

  • StayOnTaxiway = 1u
    Indicates the aircraft should remain on taxiways (not enter runways / gates as normal). Useful for forcing ground-only movements.

  • Emergency = 2u
    Marks the aircraft as an emergency (priority handling, special routing or landing behavior).

  • StayMidAir = 4u
    Keeps the aircraft in a mid-air state (e.g., holding pattern). Prevents it from landing or taxiing.

  • Blocking = 8u
    Indicates the aircraft is currently blocking (e.g., obstructing a path or area), which may affect routing or cause other vehicles to avoid it.

  • Working = 0x10u
    Shows the aircraft is currently performing some work task (e.g., refueling, loading/unloading) and may be treated differently by AI.

  • IgnoreParkedVehicle = 0x20u
    When set, the aircraft's pathing/logic ignores parked vehicles in relevant collision or parking checks.

Properties

  • None (enum type — no instance properties beyond those on System.Enum).
    Enums do not declare instance properties; use bitwise checks or Enum methods for queries.

Constructors

  • None (enum types have an implicit default value of 0).
    There is no custom constructor. The default value (0) represents no flags set.

Methods

  • Standard System.Enum methods are available (ToString, HasFlag, etc.).
    Common operations for this flags enum:
  • Check: (flags & AircraftFlags.Emergency) != 0 or flags.HasFlag(AircraftFlags.Emergency)
  • Set: flags |= AircraftFlags.Working
  • Clear: flags &= ~AircraftFlags.Blocking
  • Toggle: flags ^= AircraftFlags.StayOnTaxiway

When reading/writing flags in game systems, prefer atomic operations or proper locking if multiple threads may access the same underlying value.

Usage Example

// Combine flags
AircraftFlags flags = AircraftFlags.StayOnTaxiway | AircraftFlags.Working;

// Check a flag
if ((flags & AircraftFlags.Working) != 0)
{
    // aircraft is performing work
}

// Add a flag
flags |= AircraftFlags.IgnoreParkedVehicle;

// Remove a flag
flags &= ~AircraftFlags.Working;

// Using HasFlag (note: HasFlag boxes on older runtimes, bitwise check is faster)
if (flags.HasFlag(AircraftFlags.IgnoreParkedVehicle))
{
    // ignore parked vehicles in pathing checks
}