Game.Citizens.HealthProblemFlags
Assembly: Assembly-CSharp
Namespace: Game.Citizens
Type: public enum (flags) HealthProblemFlags : byte
Base: System.Enum (underlying type: System.Byte)
Summary:
A bit-flag enum used to describe one or more health-related states for a citizen in the game. The enum is marked with [Flags], so multiple values can be combined to represent composite conditions (for example, a citizen can be Injured and RequireTransport at the same time). Values are stored in a single byte.
Fields
-
None = 0
Represents no health problems. -
Sick = 1
The citizen is sick (illness that likely requires healthcare). -
Dead = 2
The citizen is deceased. -
Injured = 4
The citizen has sustained an injury. -
RequireTransport = 8
The citizen requires transport (for example, ambulance/evacuation). -
InDanger = 0x10
(16)
The citizen is in immediate danger / severe condition. -
Trapped = 0x20
(32)
The citizen is trapped (e.g., by debris, collapsed building). -
NoHealthcare = 0x40
(64)
The citizen lacks access to healthcare services.
Properties
- This enum type defines no properties.
Constructors
- This enum type defines no explicit constructors. The default enum behavior applies.
Methods
- No instance methods are defined on this enum. Use standard enum/bitwise operations or Enum.HasFlag to inspect or manipulate flags. Typical operations:
- Combine: bitwise OR (|) or multiple flags in assignment.
- Test: Enum.HasFlag(...) or (flags & HealthProblemFlags.SomeFlag) != 0.
- Remove/clear: flags &= ~HealthProblemFlags.SomeFlag.
- Cast to/from underlying byte: (byte)flags and (HealthProblemFlags)someByte.
Usage Example
// Combine flags
HealthProblemFlags flags = HealthProblemFlags.Sick | HealthProblemFlags.RequireTransport;
// Check for a specific flag (preferred: HasFlag or bitwise)
if (flags.HasFlag(HealthProblemFlags.RequireTransport))
{
// send ambulance / schedule transport
}
// Bitwise check (faster in hot code)
if ((flags & HealthProblemFlags.Dead) == 0)
{
// citizen is not dead
}
// Add a flag
flags |= HealthProblemFlags.InDanger;
// Remove a flag
flags &= ~HealthProblemFlags.RequireTransport;
// Convert to raw byte for storage or network transfer
byte raw = (byte)flags;
HealthProblemFlags restored = (HealthProblemFlags)raw;