Skip to content

Game.Prefabs.DistrictModifierInfo

Assembly:
Assembly-CSharp (game assembly; contains most runtime types for Cities: Skylines 2 mods)

Namespace: Game.Prefabs

Type:
class

Base:
System.Object

Summary:
Serializable data container that describes a district modifier used by the game. It stores which kind of modifier it is, how the modifier value is interpreted/applied, and the numeric range or bounds associated with the modifier. This class is a plain data holder (POD) intended for use in prefabs, configuration, or serialization.


Fields

  • public DistrictModifierType m_Type
    The kind/category of district modifier. This is typically an enum (DistrictModifierType) that identifies what property of the district is being modified (for example population, productivity, pollution, etc.). Used by the game logic to determine what the modifier affects.

  • public ModifierValueMode m_Mode
    Specifies how the modifier value should be interpreted/applied. ModifierValueMode is an enum that usually indicates modes such as Additive, Multiplicative, Absolute, or similar. This tells the game how to combine the modifier value with the base value.

  • public Bounds1 m_Range
    Numeric bounds for the modifier value. Bounds1 (from Colossal.Mathematics) represents a single-dimensional range (e.g., minimum and maximum or a single value depending on context) used to define the effective values the modifier can supply. This field defines the magnitude/limits of the modifier.

Properties

  • (none)

Constructors

  • public DistrictModifierInfo()
    Implicit default constructor (provided by the runtime). Creates an instance with default values for all fields. Fields will need to be initialized after construction if specific values are required.

Methods

  • (none)

Usage Example

using Game.Prefabs;
using Colossal.Mathematics;

// Create and initialize a district modifier info
var modifier = new DistrictModifierInfo
{
    m_Type = DistrictModifierType.Productivity,   // example enum value
    m_Mode = ModifierValueMode.Multiplicative,    // example enum value
    m_Range = new Bounds1(0.9f, 1.1f)             // +/-10% multiplier (example)
};

// This instance can then be serialized as part of a prefab or applied by game logic

Notes: - The class is marked [Serializable], so it's intended to be serialized by Unity or the game's serialization system. - The exact enum values for DistrictModifierType and ModifierValueMode, and the semantics of Bounds1, are defined elsewhere in the game's assemblies (look up those types for precise meanings). Use this class as a lightweight container for modifier configuration in prefabs or mod data.