Skip to content

Game.Areas.GeometryFlags

Assembly: Assembly-CSharp (commonly found in Assembly-CSharp.dll)
Namespace: Game.Areas

Type: enum

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

Summary:
A [Flags] enum that describes behaviour and characteristics of an area’s geometry in the game (placement, terrain modification, visibility and special requirements). Each value is a bit flag so multiple behaviours can be combined using bitwise operations. These flags are used by area/geometry systems to decide how to treat objects, terrain and placement inside an area (for example: whether terrain should be clipped or shifted, whether objects should be cleared, or whether the area requires water). {{ Useful for modders manipulating area definitions, area-based placement tools and terrain/overlay processing. }}


Fields

  • PhysicalGeometry = 1
    {{ Marks the area as containing physical geometry. Typically used for collision, placement or rendering of physical objects within the area. }}

  • CanOverrideObjects = 2
    {{ Indicates the area is allowed to override existing objects (e.g., replace or remove objects within the area during operations). }}

  • ProtectedArea = 4
    {{ Designates the area as protected — usually prevents modifications or clearing by certain operations unless explicitly allowed. }}

  • ClearArea = 8
    {{ Signals that objects, vegetation or other non-essential items in the area should be cleared. Often used by tools that need an empty footprint. }}

  • ClipTerrain = 0x10 (decimal 16)
    {{ The area should clip (cut) the terrain. Useful for creating holes or strict boundaries in terrain geometry. }}

  • ShiftTerrain = 0x20 (decimal 32)
    {{ The area causes terrain height adjustments (shifting) rather than outright clipping. Typically used to conform terrain to an object or feature. }}

  • OnWaterSurface = 0x40 (decimal 64)
    {{ Marks the area as being on a water surface (for placement or behavior that differs on water). }}

  • PseudoRandom = 0x80 (decimal 128)
    {{ Indicates pseudo-randomized behavior for object placement or generation inside the area (deterministic but appearing random). }}

  • RequireWater = 0x100 (decimal 256)
    {{ The area requires water to be present (for valid placement or certain behaviors). }}

  • HiddenIngame = 0x200 (decimal 512)
    {{ The area is hidden during gameplay (may be editor-only or excluded from runtime visuals/logic). }}

Properties

  • This enum type does not declare properties.
    {{ Use the enum value bits directly; typical operations are bitwise OR to combine flags and bitwise AND (or Enum.HasFlag) to test flags. }}

Constructors

  • Enums do not expose public constructors in the usual sense. Values are the named constants declared above.
    {{ You can assign or cast underlying integer values if necessary, but prefer the named flags for clarity and safety. }}

Methods

  • Standard System.Enum methods are available (e.g., ToString(), HasFlag(Enum), Parse, TryParse).
    {{ For performance-sensitive code (e.g., per-frame checks), prefer bitwise tests ((flags & GeometryFlags.ClearArea) != 0) over Enum.HasFlag, as HasFlag incurs boxing and is slower. }}

Usage Example

// Combine flags
GeometryFlags flags = GeometryFlags.PhysicalGeometry | GeometryFlags.ClearArea | GeometryFlags.ClipTerrain;

// Test flags (preferred for performance)
if ((flags & GeometryFlags.ClearArea) != 0)
{
    // Clear objects in the area
}

// Using HasFlag (clearer but slower)
if (flags.HasFlag(GeometryFlags.ClipTerrain))
{
    // Clip terrain logic
}

// Setting or clearing a flag
flags |= GeometryFlags.RequireWater;          // add a flag
flags &= ~GeometryFlags.HiddenIngame;         // remove a flag

{{ NOTES: Combine flags to describe complex area behaviour. Use explicit bitwise checks in hot paths; use named enum flags for readability. }}