Skip to content

Game.Prefabs.CityModifierInfo

Assembly: Game
Namespace: Game.Prefabs

Type: class

Base: System.Object

Summary:
Serializable data container used by the game to describe a city modifier entry inside a prefab or configuration. It stores the modifier type, how the modifier's value should be interpreted/applied, and the numeric range (Bounds1) that controls the modifier's effect. Instances of this class are typically created/filled by prefab loading or by mod code that manipulates prefab data.


Fields

  • public CityModifierType m_Type
    Type of the city modifier. This identifies which modifier this entry represents (for example, a specific policy, growth modifier, or other game-defined modifier). The exact enum values are defined by the City.CityModifierType enum in the Game.City namespace.

  • public ModifierValueMode m_Mode
    Mode that specifies how the modifier value is applied or interpreted (for example absolute vs. relative, or other game-specific value modes). The possible values are defined by the ModifierValueMode enum.

  • public Bounds1 m_Range
    A Bounds1 value that defines the numeric range (min/max or otherwise structured 1D bounds) used by this modifier. Bounds1 comes from Colossal.Mathematics and represents the numeric limits or curve input range that the modifier uses.

Properties

  • This class does not expose any C# properties. It uses public fields for direct data serialization and access.

Constructors

  • public CityModifierInfo()
    Default parameterless constructor is available (implicitly provided). Instances are typically created and then their public fields populated. The class is marked with [Serializable], so it is compatible with Unity/Colossal custom serialization used by the game.

Methods

  • This class does not define any methods. It is a plain data container.

Usage Example

// Create and initialize a new city modifier entry for a prefab or config.
var modifierInfo = new Game.Prefabs.CityModifierInfo
{
    m_Type = Game.City.CityModifierType.SomeModifier, // replace with actual enum value
    m_Mode = ModifierValueMode.Relative,               // replace with desired mode
    m_Range = new Colossal.Mathematics.Bounds1(0f, 1f) // example min/max range
};

// The instance can then be added to a prefab data structure or serialized
// as part of a mod's saved configuration (game-specific usage required).