Skip to content

Game.Creatures.PetFlags

Assembly: Assembly-CSharp (game)
Namespace: Game.Creatures

Type: enum

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

Summary: PetFlags is a bitwise flags enumeration that represents various runtime states a pet (creature) can have in the game. It is marked with the [Flags] attribute so multiple states can be combined using bitwise operations. Each named value corresponds to a single bit in a 32-bit unsigned integer.


Fields

  • None = 0u
    Represents no flags set. Use this to indicate a pet has no special state.

  • Disembarking = 1u
    Indicates the pet is in the process of disembarking (for example, leaving a vehicle or transport).

  • Hangaround = 2u
    Indicates the pet is lingering or waiting around (not actively moving toward a destination).

  • Arrived = 4u
    Indicates the pet has arrived at its target location or destination.

  • LeaderArrived = 8u
    Indicates the leader of a group (if the pet is part of a group) has arrived; commonly used in group movement logic.

Properties

  • This enum type does not define any properties. It exposes the standard System.Enum behavior.

Constructors

  • Enums do not define public constructors in C#. There are no user-visible constructors for this enum.

Methods

  • This enum does not declare any methods. Members inherit the usual System.Enum methods (ToString, HasFlag, etc.).

Usage Example

// Combining flags
PetFlags flags = PetFlags.Disembarking | PetFlags.Hangaround;

// Check if a specific flag is set
bool isDisembarking = (flags & PetFlags.Disembarking) != 0;
// or using Enum.HasFlag (slower due to boxing)
bool isHangaround = flags.HasFlag(PetFlags.Hangaround);

// Set a flag
flags |= PetFlags.Arrived;

// Clear a flag
flags &= ~PetFlags.Hangaround;

// Toggle a flag
flags ^= PetFlags.LeaderArrived;

// Compare to none
bool hasNoState = flags == PetFlags.None;

Additional notes: - Because the underlying type is uint, you can store up to 32 independent flags in this enum type if expanded in the future. - Prefer bitwise operators for performance-critical checks; HasFlag is convenient but may allocate/box in some contexts.