Skip to content

Game.Buildings.PoliceStationFlags

Assembly: Assembly-CSharp (game)
Namespace: Game.Buildings

Type: enum (with [Flags] attribute)

Base: System.Enum (underlying type: byte)

Summary: Flags enum used to represent the state and capabilities of a police station. Each value is a single-bit flag so multiple flags can be combined into one byte to indicate multiple simultaneous conditions (e.g., station has available patrol cars and also needs prisoner transport).


Fields

  • HasAvailablePatrolCars = 1 Indicates the station currently has one or more patrol cars available for dispatch.

  • HasAvailablePoliceHelicopters = 2 Indicates the station currently has one or more police helicopters available.

  • NeedPrisonerTransport = 4 Indicates the station requires prisoner transport (e.g., prisoners to be moved to a jail/prison).

Properties

  • This enum has no properties.
    Enums do not declare instance properties; typical usage inspects/composes values via bitwise operators or System.Enum helpers.

Constructors

  • Enums have no user-defined constructors.
    Values are assigned as declared; the underlying storage type is byte and values are used as bit flags.

Methods

  • No enum-specific methods are declared here. Use System.Enum/System.ValueType/Object members:
  • Enum.HasFlag(Enum flag) — convenient but boxes for small enum types; for performance prefer bitwise checks.
  • ToString(), GetHashCode(), etc.
  • Recommended bitwise operations:
  • Check: (flags & PoliceStationFlags.HasAvailablePatrolCars) != 0
  • Set: flags |= PoliceStationFlags.NeedPrisonerTransport
  • Clear: flags &= ~PoliceStationFlags.NeedPrisonerTransport
  • Toggle: flags ^= PoliceStationFlags.HasAvailablePoliceHelicopters

Usage Example

// set multiple flags
PoliceStationFlags flags = PoliceStationFlags.HasAvailablePatrolCars | PoliceStationFlags.HasAvailablePoliceHelicopters;

// check a flag (fast, avoids boxing)
bool hasCars = (flags & PoliceStationFlags.HasAvailablePatrolCars) != 0;

// using HasFlag (clearer but may box the enum)
bool hasHelos = flags.HasFlag(PoliceStationFlags.HasAvailablePoliceHelicopters);

// add a flag
flags |= PoliceStationFlags.NeedPrisonerTransport;

// remove a flag
flags &= ~PoliceStationFlags.HasAvailablePatrolCars;

// toggle a flag
flags ^= PoliceStationFlags.HasAvailablePoliceHelicopters;