Game.Buildings.EfficiencyFactor
Assembly:
Assembly-CSharp.dll
Namespace:
Game.Buildings
Type:
public enum
Base:
System.Byte
Summary:
Represents the various reasons or modifiers that can affect a building's operational efficiency in Cities: Skylines 2. Each enum value identifies a specific cause (e.g., destroyed, lacking utilities, sickness, city-wide modifiers, environmental factors) that the simulation can use to reduce or alter a building's effective output. The enum uses a byte underlying type for compact storage and save compatibility.
Fields
-
Destroyed
Represents a building that has been destroyed (e.g., by a disaster). Usually implies zero efficiency. -
Abandoned
The building has been abandoned by residents/workers and thus is not functioning normally. -
Disabled
The building has been disabled (for example, manually turned off). -
Fire
The building is affected by fire damage, reducing or stopping its operation until fixed. -
ServiceBudget
Insufficient budget for the service affects the building's efficiency. -
NotEnoughEmployees
The building lacks required workers, lowering its output. -
SickEmployees
High sickness among employees reduces productivity. -
EmployeeHappiness
Low employee happiness reduces efficiency. -
ElectricitySupply
Insufficient electricity supply is limiting the building. -
ElectricityFee
Electricity-related fee or cost penalty affecting operations. -
WaterSupply
Insufficient water supply is limiting the building. -
DirtyWater
Contaminated or poor-quality water affecting building performance. -
SewageHandling
Problems with sewage handling (overflows, capacity) reduce efficiency. -
WaterFee
Water-fee-related penalty affecting operations. -
Garbage
Garbage collection/service problems impair the building. -
Telecom
Telecommunications service problems affecting operation. -
Mail
Postal/mail service problems affecting operation. -
MaterialSupply
Insufficient raw materials or inputs limit production. -
WindSpeed
Environmental wind speed affecting wind-power buildings or related efficiency. -
WaterDepth
Water depth affecting water-dependent services/production (e.g., harbors, fishing). -
SunIntensity
Sun intensity affecting solar-power buildings or related efficiency. -
NaturalResources
Availability of natural resources affecting production. -
CityModifierSoftware
City-wide software modifier affecting applicable building types. -
CityModifierElectronics
City-wide electronics industry modifier. -
CityModifierIndustrialEfficiency
City-wide industrial efficiency modifier. -
CityModifierOfficeEfficiency
City-wide office efficiency modifier. -
CityModifierHospitalEfficiency
City-wide hospital efficiency modifier. -
SpecializationBonus
A positive specialization bonus (e.g., industry specialization) affecting output. -
CityModifierFishInput
City-wide modifier affecting fish input/production. -
CityModifierFishHub
City-wide modifier affecting fish hub operations. -
Count
A sentinel value representing the number of enum entries — useful for iteration and bounds checks.
Properties
- None (enum type).
Note: This enum uses a byte as underlying type. When storing or transmitting values, cast explicitly to/from byte to avoid surprises.
Constructors
- Implicit default constructor (value 0).
The default enum value is 0 (Destroyed). Enums are value types — no explicit constructors are defined.
Methods
- None defined on the enum itself.
You can create extension methods or utility helpers in your mod to convert, describe, or map these values to UI strings, icons, or game logic.
Usage Example
using Game.Buildings;
using System;
public class BuildingEfficiencyHelper
{
public static bool IsOperational(EfficiencyFactor factor)
{
// Example: consider Destroyed, Abandoned, Disabled and Fire as non-operational
switch (factor)
{
case EfficiencyFactor.Destroyed:
case EfficiencyFactor.Abandoned:
case EfficiencyFactor.Disabled:
case EfficiencyFactor.Fire:
return false;
default:
return true;
}
}
public static void IterateAllFactors()
{
for (byte b = 0; b < (byte)EfficiencyFactor.Count; b++)
{
var factor = (EfficiencyFactor)b;
Console.WriteLine($"{b}: {factor}");
}
}
}
Remarks: - Because the enum is backed by a byte, casting to/from byte is common (for compact storage in component data or saved data). - Do not change the order or numeric values if you intend to maintain save compatibility across game versions/mod updates. Use named enum values in code rather than hard-coded numbers.