Skip to content

Game.Objects.SpawnLocationFlags

Assembly: Assembly-CSharp
Namespace: Game.Objects

Type: Enum

Base: System.Enum

Summary:
A bitwise flags enumeration used to describe characteristics of a spawn location in the game (e.g., whether a spawned entity can enter/exit at that location or whether the spawn represents a parked vehicle). The [Flags] attribute allows combining multiple values using bitwise operations so multiple behaviors can be expressed in a single value.


Fields

  • AllowEnter = 1
    Flag indicating that entities spawned at this location are allowed to enter (e.g., enter a building or vehicle).

  • ParkedVehicle = 2
    Flag indicating the spawn represents a parked vehicle (as opposed to an active/traffic-spawned vehicle).

  • AllowExit = 4
    Flag indicating that entities spawned at this location are allowed to exit (e.g., leave a building or vehicle).

Properties

  • None (this is a simple enum; instances are value types representing one or a combination of the above flags).
    You can use standard Enum/ValueType methods (e.g., ToString(), HasFlag()).

Constructors

  • None explicit.
    As an enum, SpawnLocationFlags is a value type with an underlying integral type (int). Values are created by assigning one of the defined members or by combining members with bitwise OR.

Methods

  • Inherited methods from System.Enum/System.ValueType/Object apply (ToString(), HasFlag(Enum), etc.).
    Common usage patterns use bitwise operators:
  • Use bitwise OR (|) to combine flags.
  • Use bitwise AND (&) and compare to zero to test flags, or use Enum.HasFlag for readability.

Usage Example

// Combine flags: allow enter and exit at this spawn location
SpawnLocationFlags flags = SpawnLocationFlags.AllowEnter | SpawnLocationFlags.AllowExit;

// Test with HasFlag
if (flags.HasFlag(SpawnLocationFlags.AllowExit))
{
    // allow exit behavior
}

// Test with bitwise AND (more performant than HasFlag)
if ((flags & SpawnLocationFlags.ParkedVehicle) != 0)
{
    // handle parked vehicle spawn
}

// Remove a flag
flags &= ~SpawnLocationFlags.AllowEnter;

// Set a flag
flags |= SpawnLocationFlags.ParkedVehicle;