Skip to content

Game.Buildings.DeathcareFacilityFlags

Assembly: Assembly-CSharp
Namespace: Game.Buildings

Type: enum

Base: byte

Summary:
Bitwise flags representing state and capabilities of a deathcare facility (e.g., a cemetery or funeral home). The enum uses the [Flags] attribute and an underlying type of byte so multiple states can be combined into a single byte value. Typical uses: track whether the facility has available hearses, capacity for bodies, and whether it can process/store corpses or is full.


Fields

  • HasAvailableHearses = 1
    Indicates the facility currently has at least one available hearse.

  • HasRoomForBodies = 2
    Indicates there is free storage/space for additional corpses.

  • CanProcessCorpses = 4
    Indicates the facility can process corpses (e.g., perform cremation or other processing).

  • CanStoreCorpses = 8
    Indicates the facility can store corpses (e.g., morgue/storage capacity).

  • IsFull = 0x10
    Indicates the facility is full (no more capacity). 0x10 is hex for 16.

Properties

  • None (this is a plain enum type).

Constructors

  • None (enums do not define constructors in C#).

Methods

  • None (no enum-specific methods defined here). Note: standard enum methods (ToString, HasFlag, etc.) are available from System.Enum and extensions.

Usage Example

// Example usage of the flags enum
DeathcareFacilityFlags flags = DeathcareFacilityFlags.HasAvailableHearses | DeathcareFacilityFlags.CanStoreCorpses;

// Check for a specific flag
bool hasHearses = (flags & DeathcareFacilityFlags.HasAvailableHearses) != 0;

// Use HasFlag (convenience method)
bool canStore = flags.HasFlag(DeathcareFacilityFlags.CanStoreCorpses);

// Set a flag
flags |= DeathcareFacilityFlags.HasRoomForBodies;

// Clear a flag
flags &= ~DeathcareFacilityFlags.HasAvailableHearses;

// Toggle a flag
flags ^= DeathcareFacilityFlags.IsFull;

// Get raw byte value for storage/serialization
byte raw = (byte)flags;

// When printed, the [Flags] attribute will produce a comma-separated list:
string text = flags.ToString(); // e.g., "HasRoomForBodies, CanStoreCorpses"

{{ Additional notes: - Because the enum underlying type is byte, it is compact for storage in building data structures. - All member values are distinct powers of two (1,2,4,8,16) so combinations are unambiguous. - When serializing to save data, cast to/from byte to preserve the exact bit pattern. - Be careful when extending or reordering values: maintain unique bit values to avoid conflicts with existing saved data or other code that interprets specific bits. }}