Skip to content

Game.Routes.TakeoffLocationFlags

Assembly: Assembly-CSharp
Namespace: Game.Routes

Type: enum (flags)

Base: System.Enum (backing type: int)

Summary:
Flags enum used to specify allowed actions at a takeoff location (e.g., whether vehicles or passengers may enter or exit at that location). The enum is decorated with [Flags], so values can be combined with bitwise operations to represent multiple allowed behaviors simultaneously.


Fields

  • AllowEnter = 1
    Indicates that entering is allowed at the takeoff location (e.g., passengers or vehicles may board/enter).

  • AllowExit = 2
    Indicates that exiting is allowed at the takeoff location (e.g., passengers or vehicles may disembark/exit).

Note: Because this is a flags enum, AllowEnter | AllowExit has the combined value 3 and represents both actions permitted.

Properties

  • This enum defines no properties. Use standard enum APIs (e.g., Enum.ToString) or bitwise checks / Enum.HasFlag to inspect values.

Constructors

  • Enums do not declare custom constructors here. The default underlying integer values (1 and 2) are used. You can cast integers to this enum if needed.

Methods

  • No methods are defined on this enum itself. Use the standard System.Enum methods or bitwise operators:
  • flags.HasFlag(TakeoffLocationFlags.AllowEnter)
  • (flags & TakeoffLocationFlags.AllowExit) != 0

Usage Example

// Combine flags to allow both enter and exit
TakeoffLocationFlags flags = TakeoffLocationFlags.AllowEnter | TakeoffLocationFlags.AllowExit;

// Check with bitwise operator
if ((flags & TakeoffLocationFlags.AllowEnter) != 0)
{
    // allow boarding logic
}

// Or using HasFlag (slower, but clearer)
if (flags.HasFlag(TakeoffLocationFlags.AllowExit))
{
    // allow disembarking logic
}

// Example: restrict to enter-only
flags = TakeoffLocationFlags.AllowEnter;

Additional notes: - Because there is no explicit "None = 0" member in this enum, a value of 0 implies neither enter nor exit allowed; consider defining a None value if you need to represent that state by name. - Use this enum where route/takeoff location behavior needs to be configured in mod code (e.g., airport/heliport takeoff handling).