Skip to content

Game.Prefabs.ZoneDensity

Assembly:
{{ Likely part of the game's core assembly (e.g., Game.dll). If you need the exact assembly name, extract it from the compiled game/mod assemblies. }}

Namespace: Game.Prefabs

Type: enum

Base: System.Enum (underlying type: byte)

Summary:
{{ Represents zoning density categories used by the game for prefabs/zones. This enum classifies zones into three density levels — Low, Medium and High — which the game code uses to select building variations, spawn logic, and density-dependent behaviour. The underlying storage is a byte to keep the enum compact for large arrays or network serialization. }}


Fields

  • Low
    {{ Represents the lowest density category. Value = 0. Used for small buildings, lower population/traffic impact, and low-rise variants. }}

  • Medium
    {{ Represents the medium/intermediate density category. Value = 1. Used for mid-rise buildings and moderate population/traffic impact. }}

  • High
    {{ Represents the highest density category. Value = 2. Used for high-rise variants with higher population/traffic impact and different simulation rules. }}

Properties

  • public (no specific properties on the enum type)
    {{ This enum exposes no instance properties; you can use standard enum operations (e.g., ToString(), comparisons). If you need the numeric underlying value, cast to byte: (byte)ZoneDensity.High. }}

Constructors

  • (none — enum has no public constructors)
    {{ Enums cannot define custom constructors in typical usage here. The default backing values are 0..N-1 unless explicitly set. The default (zero) value corresponds to ZoneDensity.Low. }}

Methods

  • (none declared on this enum)
    {{ The enum inherits typical System.Enum methods such as ToString(), HasFlag (not meaningful for non-flags enum), and static methods like Enum.Parse and Enum.TryParse. Use those when converting from strings or generic code. }}

Usage Example

// Assigning and using the enum
ZoneDensity density = ZoneDensity.Medium;

switch (density)
{
    case ZoneDensity.Low:
        // handle low-density behavior
        break;
    case ZoneDensity.Medium:
        // handle medium-density behavior
        break;
    case ZoneDensity.High:
        // handle high-density behavior
        break;
}

// Casting to underlying byte for serialization or compact storage
byte raw = (byte)ZoneDensity.High;

// Parsing from string (safe)
if (Enum.TryParse<ZoneDensity>("High", out var parsed))
{
    // parsed == ZoneDensity.High
}

{{ Notes: If you extend this enum in a mod, be cautious about binary compatibility and serialization with existing save/game data. Prefer adding explicit numeric values if gaps or future changes are anticipated. }}