Skip to content

Game.Creatures.WildlifeFlags

Assembly: Assembly-CSharp
Namespace: Game.Creatures

Type: enum

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

Summary: A flags enum representing discrete behavioral states for wildlife creatures in the game. Marked with the [Flags] attribute, values can be combined using bitwise operations to represent multiple simultaneous states (where meaningful). Typical usage is to check whether a particular behavior flag is set on a creature's current state mask.


Fields

  • WildlifeFlags.None = 0u Represents no flags set. Use this value to indicate the creature currently has no tracked behavior flags.

  • WildlifeFlags.Idling = 1u Indicates the creature is idling (not moving/performing active behaviors). This is the first bit flag (0x1).

  • WildlifeFlags.Wandering = 2u Indicates the creature is wandering (moving about without a specific target). This is the second bit flag (0x2).

Properties

  • None
    This enum does not declare properties. Use bitwise operations or Enum helper methods to query values.

Constructors

  • None (enum)
    As a C# enum, no custom constructors are defined. Values are assigned as constants.

Methods

  • None (defined on enum type)
    There are no instance methods declared on this enum. Standard System.Enum and extension methods are available (for example, Enum.HasFlag(object) or bitwise operations). Note: Enum.HasFlag is convenient but slightly slower than manual bitwise checks — prefer (flags & WildlifeFlags.Wandering) != 0 in performance-sensitive code.

Usage Example

// Combine flags
WildlifeFlags state = WildlifeFlags.Idling | WildlifeFlags.Wandering;

// Check a specific flag (preferred for performance)
if ((state & WildlifeFlags.Wandering) != 0)
{
    // handle wandering behavior
}

// Check for no flags
if (state == WildlifeFlags.None)
{
    // no behavior flags set
}

// Set a flag
state |= WildlifeFlags.Idling;

// Clear a flag
state &= ~WildlifeFlags.Idling;

// Cast from an unsigned integer (e.g., loaded from save/state)
uint raw = 2u;
WildlifeFlags fromRaw = (WildlifeFlags)raw;
if ((fromRaw & WildlifeFlags.Wandering) != 0) { /* ... */ }