Skip to content

Game.UI.InGame.CitizenAgeKey

Assembly:
Assembly-CSharp (typical for game code; actual assembly may vary)
Namespace: Game.UI.InGame

Type:
enum

Base:
System.Enum

Summary:
Defines the age categories used by the in-game UI to represent a citizen's life stage. These enum values are used for grouping, display, filtering, and logic that depends on a citizen's age bracket. Underlying integer values start at 0 (Child = 0, Teen = 1, Adult = 2, Elder = 3).


Fields

  • Child
    Represents a child age group. Typically used for UI icons, filters, or logic that treats children differently (schooling, restrictions).

  • Teen
    Represents a teenage age group. Used where teen-specific behavior or display is needed.

  • Adult
    Represents an adult age group. Common default working-age category for many systems.

  • Elder
    Represents an elderly/retired age group. Used for retirement, pension, or elder-specific UI elements.

Properties

  • None (enum type; no properties)

Constructors

  • None (enums do not expose custom constructors; values are defined as constants)

Methods

  • None (no methods defined on this enum)

Usage Example

using Game.UI.InGame;

public void UpdateCitizenIcon(CitizenAgeKey ageKey)
{
    switch (ageKey)
    {
        case CitizenAgeKey.Child:
            ShowIcon("icon_child");
            break;
        case CitizenAgeKey.Teen:
            ShowIcon("icon_teen");
            break;
        case CitizenAgeKey.Adult:
            ShowIcon("icon_adult");
            break;
        case CitizenAgeKey.Elder:
            ShowIcon("icon_elder");
            break;
    }
}

// Converting from/to integer (e.g., stored index)
int index = (int)CitizenAgeKey.Adult;          // 2
CitizenAgeKey fromIndex = (CitizenAgeKey)index;