Skip to content

Game.City.StatisticCollectionType

Assembly: Assembly-CSharp
Namespace: Game.City

Type: public enum

Base: System.Enum

Summary: An enumeration that defines how a particular game statistic is collected and interpreted by the game's telemetry/statistics systems. Typical usage in Cities: Skylines 2 mods: choose whether a statistic represents a value recorded once at a point in time (Point), a value that is recorded per day (Daily), or an accumulating total over time (Cumulative). This informs how the engine aggregates, stores and displays the statistic (e.g., charting, resets, and accumulation behavior).


Fields

  • Daily
    Represents a statistic that is collected on a daily basis. Each day the value is recorded (for charts or daily reports) and typically treated as discrete per-day samples. Useful for metrics that need daily sampling or reset semantics (for example: daily income, daily visitors).

  • Point
    Represents an instantaneous or point-in-time measurement. This is used for statistics that capture the current state at a specific moment rather than accumulating or being sampled by day (for example: current population, current traffic jam count).

  • Cumulative
    Represents a statistic that accumulates over time. Values of this type are summed/accumulated rather than sampled or reset periodically (for example: total money earned since start, total vehicles produced).

Properties

  • This enum type does not expose properties. It is a simple value type with named constants (underlying type: System.Int32).

Constructors

  • Enums do not have explicit constructors in source. The underlying values are:
  • Daily = 0
  • Point = 1
  • Cumulative = 2

Methods

  • No custom methods are defined on this enum. As with all enums, standard System.Enum methods are available (ToString(), HasFlag(), GetValues(), etc.). Serialization/deserialization behavior follows Unity/.NET enum conventions; if storing in custom save data, convert to/from int or string as needed.

Usage Example

using Game.City;

public class StatisticReporter
{
    public void Report(StatisticCollectionType type, float value)
    {
        switch (type)
        {
            case StatisticCollectionType.Daily:
                // store value in daily series (sample for the current day)
                RecordDaily(value);
                break;
            case StatisticCollectionType.Point:
                // update the current instantaneous value
                UpdatePointValue(value);
                break;
            case StatisticCollectionType.Cumulative:
                // add to a running total
                AddToCumulative(value);
                break;
        }
    }

    private void RecordDaily(float v) { /* implementation */ }
    private void UpdatePointValue(float v) { /* implementation */ }
    private void AddToCumulative(float v) { /* implementation */ }
}

Notes for modders: - Choose the correct collection type to ensure charts and reports behave as expected. - When serializing for custom persistence, prefer storing the enum as an int (explicit cast) for compact storage and backwards compatibility across enum renames.