Skip to content

Game.Citizens.PartnerType

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

Type: public enum
Base: System.Enum (underlying type: System.Int32)

Summary: An enumeration that describes the allowed or actual partner type for a citizen. Commonly used in the citizen relationship/marriage/household logic to indicate whether a citizen has no partner, a partner of the same type, a partner of the other type, or any partner type. The enum values are backed by integers (None = 0, Same = 1, Other = 2, Any = 3), which can be useful to store or serialize compactly.


Fields

  • None
    Represents no partner or "no preference" (value = 0).

  • Same
    Represents a partner of the same type (value = 1). In a citizens context this is often used to indicate same-gender or same-category partner depending on the game's internal semantics.

  • Other
    Represents a partner of the other type (value = 2). Often used to indicate an opposite-gender or different-category partner.

  • Any
    Represents any partner type (value = 3). Useful when no restriction is required or when matching logic should accept either Same or Other.

Properties

  • (None)
    This is a plain enum type; it does not define properties. It inherits standard System.Enum behavior (ToString, HasFlag when applicable, etc.).

Constructors

  • (None)
    Enums do not expose explicit constructors. The underlying integer values map as listed above.

Methods

  • (None declared)
    No custom methods are declared on this enum. You can use standard System.Enum methods such as Enum.Parse, Enum.TryParse, Enum.GetValues, and the instance method ToString().

Usage Example

using Game.Citizens;

public class CitizenRelationshipExample
{
    public void Example()
    {
        PartnerType preference = PartnerType.Any;

        // Assign or check partner types
        if (preference == PartnerType.None)
        {
            // citizen has no partner or preference set
        }
        else if (preference == PartnerType.Same)
        {
            // match with same-type partners
        }

        // store as integer for compact serialization
        int stored = (int)PartnerType.Other;

        // parse from string (e.g., from config)
        if (Enum.TryParse<PartnerType>("Same", out var parsed))
        {
            // parsed == PartnerType.Same
        }
    }
}

{{ This enum is small and straightforward; when modding, ensure that any systems that consume PartnerType handle the Any value appropriately (treating it as an accept-all), and be careful when changing the numeric values if you need compatibility with saved data or networked state. }}