Skip to content

Game.Net.CoverageService

Assembly:
Assembly-CSharp (typical for Cities: Skylines 2 game code / modding; actual assembly may vary)

Namespace: Game.Net

Type: public enum

Base: System.Enum (underlying type: System.Byte)

Summary: An enum representing the different types of public-service "coverage" categories used by the game's networking/coverage systems. Each value corresponds to a specific service type (healthcare, police, parks, etc.) and is commonly used as an index into coverage arrays, lookups, or service-specific logic. The final entry, Count, provides the number of service categories.


Fields

  • Healthcare This represents the healthcare coverage category. Underlying numeric value: 0.

  • FireRescue Represents fire & rescue coverage. Underlying numeric value: 1.

  • Police Represents police coverage. Underlying numeric value: 2.

  • Park Represents park-related coverage. Underlying numeric value: 3.

  • PostService Represents postal service coverage. Underlying numeric value: 4.

  • Education Represents education-related coverage (schools, libraries, etc.). Underlying numeric value: 5.

  • EmergencyShelter Represents emergency shelter coverage. Underlying numeric value: 6.

  • Welfare Represents welfare/social service coverage. Underlying numeric value: 7.

  • Count A helper entry containing the number of defined service categories. Useful for iteration and array sizing. Underlying numeric value: 8.

Properties

  • This enum does not define properties. Use casting to/from int/byte as needed (e.g., (int)CoverageService.Police).

Constructors

  • Enums do not define explicit constructors in source. A default (compiler-provided) constructor exists; values are compiled constants.

Methods

  • This enum does not declare instance methods. Standard System.Enum and System.ValueType methods (ToString, Parse, GetValues, etc.) are available via the type system.

Usage Example

// Get number of coverage types
int coverageTypes = (int)Game.Net.CoverageService.Count;

// Iterate over all defined coverage types
for (int i = 0; i < coverageTypes; i++)
{
    var service = (Game.Net.CoverageService)i;
    // Use `service` as an index into arrays that store per-service coverage info:
    // coverageArray[i] or coverageArray[(int)service]
}

// Example: increment a coverage counter for police
int[] coverageCounts = new int[(int)Game.Net.CoverageService.Count];
coverageCounts[(int)Game.Net.CoverageService.Police]++;

// Example: storing/transmitting as byte
byte serviceByte = (byte)Game.Net.CoverageService.Education;
Game.Net.CoverageService serviceFromByte = (Game.Net.CoverageService)serviceByte;

{{ Additional notes: - When writing mods, cast this enum to int when using it as an index into arrays or lists. - The enum underlying type is byte, so it is compact for network/state storage. Be careful when persisting values across versions if the enum is extended or reordered. - The Count member is intended for bounds and iteration; avoid relying on its exact numeric value except to size arrays or loops. }}