Skip to content

Game.Buildings.HospitalFlags

Assembly:
Assembly-CSharp

Namespace:
Game.Buildings

Type:
enum (flag)

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

Summary:
HospitalFlags is a [Flags]-annotated byte-backed enum that describes various capability and status bits for hospital buildings. Each flag represents a specific capability or availability state such as whether ambulances are available, whether the hospital can cure disease or injuries, whether it has room for patients, or if it can process corpses. These flags are intended to be combined with bitwise operations to represent multiple capabilities simultaneously in a compact form.


Fields

  • HasAvailableAmbulances = 1
    Indicates the hospital currently has ambulances available to respond to emergencies.

  • HasAvailableMedicalHelicopters = 2
    Indicates the hospital currently has medical helicopters available for air transport.

  • CanCureDisease = 4
    Indicates the hospital has the capability/resources to cure diseases (used in disease treatment logic).

  • HasRoomForPatients = 0x10 (16)
    Indicates the hospital has available capacity/beds for additional patients.

  • CanProcessCorpses = 0x20 (32)
    Indicates the hospital can process (handle) corpses, e.g., transfer to mortuary/cremation systems.

  • CanCureInjury = 0x40 (64)
    Indicates the hospital is capable of treating injuries (distinct from disease treatment).

Properties

  • This enum type does not define any properties.
    Use standard enum/bitwise operations or System.Enum helpers (like Enum.HasFlag) to query or modify flags.

Constructors

  • Enums do not expose public constructors in C#.
    The default value is zero (no flags set). You can create an enum value by casting from the underlying numeric type, e.g. (HospitalFlags)0x10.

Methods

  • This enum does not declare methods.
    Common operations are performed via language operators or System.Enum helper methods:
  • Bitwise OR (|) to combine flags.
  • Bitwise AND (&) to test flags.
  • Enum.HasFlag to test for a specific flag (note: HasFlag is slower than bitwise checks).
  • Cast to/from byte when interacting with storage or native APIs that expect the underlying byte.

Usage Example

// Combine flags
HospitalFlags flags = HospitalFlags.HasAvailableAmbulances | HospitalFlags.HasRoomForPatients;

// Check via bitwise operation (recommended for performance)
bool hasAmbulance = (flags & HospitalFlags.HasAvailableAmbulances) != 0;

// Check via Enum.HasFlag (clearer but slightly slower)
bool hasRoom = flags.HasFlag(HospitalFlags.HasRoomForPatients);

// Add a flag
flags |= HospitalFlags.CanCureDisease;

// Remove a flag
flags &= ~HospitalFlags.HasAvailableMedicalHelicopters;

// Store/read underlying byte
byte raw = (byte)flags;
HospitalFlags fromRaw = (HospitalFlags)raw;

{{ This enum is commonly used by building logic in Cities: Skylines 2 mods to represent and query hospital capabilities and availability in an efficient bitmask form. When serializing or interfacing with native code, remember the underlying type is byte, so cast appropriately. }}