Skip to content

Game.Prefabs.PetType

Assembly: Assembly-CSharp (game binary)
Namespace: Game.Prefabs

Type: public enum (byte)

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

Summary:
Enum representing pet types used by the game's prefabs/system. The enum is stored as a byte to minimize memory and save-file footprint. Currently it only defines a single pet type (Dog), but it is designed to be extended if more pet types are added by the game or mods. When using this enum in mods, be mindful of serialization/versioning (changing enum values can affect saved data compatibility).


Fields

  • Dog
    Represents the dog pet type. Implicit underlying value is 0 (as this is the only defined member).

Properties

  • None.
    This enum does not declare any properties.

Constructors

  • None (enums do not expose constructors).
    Instances are created by assigning enum values or by casting from the underlying byte value.

Methods

  • None declared by this enum.
    Inherited methods from System.Enum/System.ValueType/Object are available (e.g., ToString(), GetHashCode(), Equals(), HasFlag when applicable).

Usage Example

// Simple usage
PetType pet = PetType.Dog;

if (pet == PetType.Dog)
{
    // Handle dog-specific logic
    Debug.Log("Pet is a dog.");
}

// Casting to/from the underlying byte (useful for serialization)
byte raw = (byte)pet;            // 0
PetType fromRaw = (PetType)raw; // PetType.Dog

// Switch example
switch (pet)
{
    case PetType.Dog:
        // ...
        break;
    // Add more cases if enum is extended
}

Additional notes for modders: - Because the enum uses byte as the underlying type, casting to byte is safe and produces a compact representation for storage or network messages. - Avoid changing the numeric values of existing members in updates; instead append new members to maintain backward compatibility with saved games and existing mod data.