Skip to content

Game.Prefabs.AllowedWaterTypes

Assembly: Assembly-CSharp.dll
Namespace: Game.Prefabs

Type: enum

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

Summary:
AllowedWaterTypes is a [Flags] enum used to specify which types of water are allowed for a prefab (e.g., terrain features, building placement, or other game objects). Because it uses the Flags attribute, values can be combined with bitwise operations to represent multiple allowed water types simultaneously.


Fields

  • None = 0
    Represents no allowed water type.

  • Groundwater = 1
    Represents groundwater being allowed (bit 0).

  • SurfaceWater = 2
    Represents surface water being allowed (bit 1).

Properties

  • (None declared on this enum)
    Enums do not declare instance properties here. Use bitwise checks or Enum.HasFlag to inspect values.

Constructors

  • (None declared)
    Enum types do not expose custom constructors in C#. Each named value is a constant of the enum type.

Methods

  • (None declared)
    No methods are declared on this enum. You may use System.Enum and System.ValueType methods (e.g., ToString(), HasFlag(), etc.) on instances.

Usage Example

// Allow both groundwater and surface water
AllowedWaterTypes allowed = AllowedWaterTypes.Groundwater | AllowedWaterTypes.SurfaceWater;

// Check for a specific type (bitwise)
bool allowsSurface = (allowed & AllowedWaterTypes.SurfaceWater) != 0;

// Or using Enum.HasFlag
bool allowsGround = allowed.HasFlag(AllowedWaterTypes.Groundwater);

// Remove a flag
allowed &= ~AllowedWaterTypes.SurfaceWater;

// Set a single flag
allowed = AllowedWaterTypes.Groundwater;

{{ This enum is typically used when determining placement rules or environmental compatibility for prefabs within Cities: Skylines 2 mods. Because it is a [Flags] enum, combine values to express multiple allowed water types and use bitwise operations or HasFlag to test them. }}