Game.Prefabs.ActivityCondition
Assembly: Assembly-CSharp.dll (typical; actual assembly may vary)
Namespace: Game.Prefabs
Type: public enum (flags)
Base: System.Enum (underlying type: System.UInt32)
Summary:
Represents a set of activity-related conditions for an entity in the game. Marked with the [Flags] attribute so multiple conditions can be combined using bitwise operations. Typical uses include testing or setting state like Homeless, Angry, Sad, Happy, and Waiting.
Fields
-
Homeless = 1u
Flag value indicating the entity is homeless. -
Angry = 2u
Flag value indicating the entity is angry. -
Sad = 4u
Flag value indicating the entity is sad. -
Happy = 8u
Flag value indicating the entity is happy. -
Waiting = 0x10u
Flag value indicating the entity is waiting.
Properties
- This enum type defines no properties. Use bitwise operations to inspect or combine flags.
Constructors
- Enums do not define runtime constructors in user code. The enum has an implicit default value (0) which corresponds to no flags set.
Methods
- No custom methods are defined on this enum. Standard System.Enum methods (ToString, HasFlag, Parse, etc.) are available.
Usage Example
// Combine flags
ActivityCondition cond = ActivityCondition.Homeless | ActivityCondition.Waiting;
// Check for a flag
bool isWaiting = (cond & ActivityCondition.Waiting) != 0;
// or using Enum.HasFlag (boxing cost)
bool isHomeless = cond.HasFlag(ActivityCondition.Homeless);
// Add a flag
cond |= ActivityCondition.Happy;
// Remove a flag
cond &= ~ActivityCondition.Homeless;