Game.HouseholdWealthKey
Assembly: Assembly-CSharp.dll
Namespace: Game.UI.InGame
Type: enum
Base: System.Enum (underlying type: System.Int32)
Summary:
Represents discrete household wealth tiers used by the in-game UI. Typically used to categorize households, select icons/labels, filter lists, or drive UI elements that reflect a household's economic status (from lowest to highest wealth).
Fields
-
Wretched
Lowest wealth tier. Implicit integer value = 0. Used for very poor households. -
Poor
Second-lowest wealth tier. Implicit integer value = 1. -
Modest
Middle wealth tier. Implicit integer value = 2. -
Comfortable
Second-highest wealth tier. Implicit integer value = 3. -
Wealthy
Highest wealth tier. Implicit integer value = 4.
Properties
- This enum defines no properties.
Constructors
- Enums do not declare explicit constructors in source. The underlying type is System.Int32 and the compiler provides default behavior. The default value (0) corresponds to
Wretched
. You can cast between int and the enum, e.g.(HouseholdWealthKey)2 == HouseholdWealthKey.Modest
.
Methods
- No custom methods are declared on this enum. It inherits standard System.Enum members such as:
- ToString() — returns the name of the enum value.
- Enum.Parse / Enum.TryParse — parse a string to the enum.
- Enum.GetValues / Enum.GetNames — enumerate defined values/names.
Usage Example
using Game.UI.InGame;
public void UpdateWealthUI(HouseholdWealthKey wealth)
{
// Direct assignment
var current = HouseholdWealthKey.Comfortable;
// Switch to choose an icon or color
switch (wealth)
{
case HouseholdWealthKey.Wretched:
ShowWealthIcon("icon_wretched");
break;
case HouseholdWealthKey.Poor:
ShowWealthIcon("icon_poor");
break;
case HouseholdWealthKey.Modest:
ShowWealthIcon("icon_modest");
break;
case HouseholdWealthKey.Comfortable:
ShowWealthIcon("icon_comfortable");
break;
case HouseholdWealthKey.Wealthy:
ShowWealthIcon("icon_wealthy");
break;
}
}
// Parsing from an integer (e.g., saved data or network)
int savedValue = 3;
HouseholdWealthKey parsed = (HouseholdWealthKey)savedValue; // -> Comfortable
// Parsing from string
if (Enum.TryParse<HouseholdWealthKey>("Wealthy", out var result))
{
// result == HouseholdWealthKey.Wealthy
}
Additional notes: - When modding, ensure any UI mapping (icons, colors, labels) matches the enum values and ordering, since other systems may rely on the numeric ordering (0 = lowest -> 4 = highest).