Skip to content

Game.Zones.AreaType

Assembly:
Assembly-CSharp (game code — may be compiled into the game's main assembly)

Namespace:
Game.Zones

Type:
public enum AreaType : byte

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

Summary:
Represents zone/area categories used by the game's zoning system. Values are stored as a single byte and are used to classify map areas (for example when assigning zoning rules, rendering overlays, or serializing area data). The enum defines a small fixed set of zone types: None, Residential, Commercial, and Industrial.


Fields

  • None
    Represents the absence of an area type (value 0). Use when no zoning/classification is set.

  • Residential
    Residential zone type (value 1). Used for housing-related zoning and logic.

  • Commercial
    Commercial zone type (value 2). Used for retail/office zoning and logic.

  • Industrial
    Industrial zone type (value 3). Used for factories, production and related logic.

Properties

  • (None specific to this enum)
    Enum values have no additional properties. Standard System.Enum/Object properties/methods are available (like ToString(), GetHashCode(), etc.).

Constructors

  • (No explicit constructors)
    Enums do not expose constructors; the default value is AreaType.None (underlying value 0). You can cast from numeric types, e.g. (AreaType)byteValue, but ensure the value maps to a defined member.

Methods

  • (No custom methods)
    Only the methods inherited from System.Enum/System.Object are available (ToString, Parse/TryParse, CompareTo, etc.). If you need custom behavior, implement extension methods or switch statements in your code.

Usage Example

// Assigning and checking area types
AreaType zone = AreaType.Residential;

if (zone == AreaType.Residential)
{
    // apply residential-specific logic
}

// Using a switch for different logic per area type
switch (zone)
{
    case AreaType.None:
        // handle unassigned area
        break;
    case AreaType.Residential:
        // residential handling
        break;
    case AreaType.Commercial:
        // commercial handling
        break;
    case AreaType.Industrial:
        // industrial handling
        break;
}

// Storing/retrieving as a byte (serialization or compact storage)
byte raw = (byte)zone;
AreaType restored = (AreaType)raw;

{{ Additional notes: - Because the enum uses byte as the underlying type, it's compact for storage and network transmission. - When reading raw bytes from save data or pipes, validate values (e.g., check they map to a defined AreaType) to avoid invalid enum states. - If modding and extending behavior for new area classes, avoid changing the numeric values of existing members to preserve save compatibility. }}