Game.Citizens.CitizenHappiness
Assembly: Assembly-CSharp.dll
Namespace: Game.Citizens
Type: public enum
Base: System.Enum (underlying type: System.Int32)
Summary: Represents the discrete happiness state of a citizen in the simulation. This enum is used by citizen/household logic, UI, and other game systems (e.g., services, taxation, and emigration) to reason about a citizen's mood and to drive behavior such as work efficiency, consumption, and likelihood to leave the city. Values are ordered from lowest to highest happiness.
Fields
-
Depressed
(0)
Represents the lowest happiness state. Citizens in this state have poor satisfaction with living conditions and are at high risk of emigrating, causing reduced productivity and increased social problems. -
Sad
(1)
Below-average happiness. Citizens are dissatisfied but not at the worst state. May impact service usage and contribute to lower revenues or reduced workplace performance. -
Neutral
(2)
Baseline state. Citizen is neither notably unhappy nor happy. Typical default/average mood for many citizens when most needs are met. -
Content
(3)
Above-average happiness. Citizens are generally satisfied — better productivity, stable tax contribution, and lower chances of leaving. -
Happy
(4)
Highest happiness state. Citizens are pleased with services and quality of life. Best outcomes for productivity, economic contributions, and minimal emigration risk.
Properties
- This enum type has no instance properties. Use casting to/from int (e.g., (int)CitizenHappiness.Happy) or use System.Enum helper methods when needed.
Constructors
- Enums do not expose public constructors. Values are compile-time constants. The default value for the enum type is the member with numeric value 0 (here: Depressed) unless otherwise specified.
Methods
- No custom methods are defined on this enum. Standard System.Enum and System.ValueType operations are available (ToString(), Parse, HasFlag if using flags, etc.). You can also compare values, cast to int, or use them in switch statements.
Usage Example
using Game.Citizens;
public class CitizenMoodExample
{
public void UpdateCitizenMood(Citizen citizen)
{
// Example: determine mood from a computed score (range and thresholds are illustrative)
int happinessScore = ComputeHappinessScore(citizen);
CitizenHappiness mood;
if (happinessScore <= 20)
mood = CitizenHappiness.Depressed;
else if (happinessScore <= 40)
mood = CitizenHappiness.Sad;
else if (happinessScore <= 60)
mood = CitizenHappiness.Neutral;
else if (happinessScore <= 80)
mood = CitizenHappiness.Content;
else
mood = CitizenHappiness.Happy;
citizen.Mood = mood;
// Example reaction
switch (mood)
{
case CitizenHappiness.Depressed:
// apply penalties, increase emigration chance, show warning in UI, etc.
break;
case CitizenHappiness.Happy:
// give bonuses, improve productivity, etc.
break;
}
}
private int ComputeHappinessScore(Citizen citizen)
{
// Placeholder: combine service coverage, pollution, taxes, employment, etc.
return 50;
}
}
Notes for modders: - Treat this enum as a lightweight, semantic classification; concrete threshold values and exact simulation effects are implemented elsewhere in the game's code. When writing custom logic (AI overrides, UI mods, or simulation hooks), map your internal scores to these states consistently to ensure compatibility with other systems and with vanilla UI expectations.