Game.DemandFactor
Assembly: Assembly-CSharp.dll
Namespace: Game.Simulation
Type: public enum
Base: System.Enum
Summary:
DemandFactor is an enumeration used by the city simulation to identify distinct demand-related factors that affect production, consumption, workforce, zoning and other simulation subsystems. Each enum member represents a specific aspect of demand or capacity that the simulation can query, adjust or aggregate. The final member, Count, is typically used as the size sentinel when allocating arrays or iterating over all defined factors.
Fields
-
StorageLevels
Represents demand or state related to storage levels (e.g., warehouse stockpiles) that may influence production/transport decisions. -
UneducatedWorkforce
Tracks demand or availability relating to the uneducated segment of the workforce. -
EducatedWorkforce
Tracks demand or availability relating to the educated segment of the workforce. -
CompanyWealth
Represents company income/wealth influence on local economic demand (e.g., business investment or expansion). -
LocalDemand
General local consumer demand for goods and services within a district/area. -
Unemployment
Represents unemployment-related demand (e.g., pressure on jobs, social services). -
FreeWorkplaces
Represents available workplaces (vacant jobs) that influence employment demand. -
Happiness
A demand factor influenced by citizen satisfaction — can affect tourism, retention and other behaviors. -
Homelessness
Represents deficits of housing (homeless citizen count) that affect social demand and policy effects. -
TouristDemand
Demand coming from tourists (affects service usage, commercial demand, attractions). -
LocalInputs
Represents demand for local inputs or raw materials used by local production chains. -
Taxes
Taxation level influence on demand (consumer/business reactions to tax changes). -
Students
Represents demand or counts related to student population (education demand/flow). -
EmptyBuildings
Tracks empty/unused buildings which may affect local demand or economic signals. -
EmptyZones
Tracks empty/zoned but undeveloped tiles which indicate unmet development demand. -
PoorZoneLocation
Represents demand/suitability related to poor zone placement (affects low-income housing demand). -
PetrolLocalDemand
Local demand for petrol (fuel) — relevant for transport and industry requiring fuel. -
Warehouses
Demand/supply related specifically to warehouses (storage infrastructure). -
Count
Sentinel value representing the number of defined demand factors. Commonly used to size arrays or iterate over all factors.
Properties
- (none)
This enum defines named constants only; there are no properties.
Constructors
- (implicit)
As with all enums, a default underlying value constructor exists but is not user-declared. Each named value maps to an integral value starting at 0 (StorageLevels = 0) up to Count.
Methods
- (none)
No instance methods are defined on the enum type. Use standard Enum utilities (e.g., Enum.GetValues, Enum.IsDefined) if needed.
Usage Example
// Example: sizing an array to store per-factor weights
int factorCount = (int)Game.Simulation.DemandFactor.Count;
float[] factorWeights = new float[factorCount];
// set a weight for TouristDemand
factorWeights[(int)Game.Simulation.DemandFactor.TouristDemand] = 1.25f;
// example usage in a switch
Game.Simulation.DemandFactor f = Game.Simulation.DemandFactor.Unemployment;
switch (f)
{
case Game.Simulation.DemandFactor.Unemployment:
// adjust job creation logic
break;
case Game.Simulation.DemandFactor.TouristDemand:
// adjust tourist service provisioning
break;
// handle other factors as needed
}
Notes for modders: - DemandFactor.Count is useful to allocate arrays or iterate through all factors safely. - Enum values are compiled into the game; you cannot add new enum members at runtime. If you need custom factors, keep separate lookup structures keyed by your own identifiers. - Use casting to/from int when indexing arrays or interfacing with systems that expect integral factor indices.