Skip to content

Game.Pathfind.SetupTargetFlags

Assembly: Assembly-CSharp.dll (game assembly)
Namespace: Game.Pathfind

Type: public enum (flags)

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

Summary:
SetupTargetFlags is a bitmask (Flags) enum used by the pathfinding / routing systems to categorize and mark pathfinding targets and target requirements (e.g., building types, import/export, transport requirement, path end marker). Values are powers-of-two so they can be combined to represent multiple target characteristics at once.


Fields

  • None = 0u
    Represents no flags set.

  • Industrial = 1u
    Marks an industrial target.

  • Commercial = 2u
    Marks a commercial target.

  • Import = 4u
    Marks an import-related target (incoming goods).

  • Service = 8u
    Marks a service target (services/utility locations).

  • Residential = 0x10u
    Marks a residential target.

  • Export = 0x20u
    Marks an export-related target (outgoing goods).

  • SecondaryPath = 0x40u
    Indicates this is a secondary path (used for alternate routing logic).

  • RequireTransport = 0x80u
    Indicates the target requires transport (e.g., a vehicle/transportation requirement).

  • PathEnd = 0x100u
    Marks the path end; used to identify destination endpoints in pathfinding.

Properties

  • None (enum type)
    Enum values are used directly; there are no instance properties defined on this type.

Constructors

  • None (enum type)
    As an enum, there are no explicit constructors to call. Values are created/combined via literals and bitwise operations.

Methods

  • None (declared on this type)
    Use standard System.Enum static/extension methods or bitwise operators (|, &, ~) and Enum.HasFlag when working with these flags.

Usage Example

// Combine flags
SetupTargetFlags target = SetupTargetFlags.Residential | SetupTargetFlags.RequireTransport;

// Check flags (recommended approach for performance-critical code: bitwise check)
bool requiresTransport = (target & SetupTargetFlags.RequireTransport) != 0;

// Or using Enum.HasFlag (slower, but clearer)
bool isResidential = target.HasFlag(SetupTargetFlags.Residential);

// Remove a flag
target &= ~SetupTargetFlags.RequireTransport;

// Test multiple flags
bool isResOrService = (target & (SetupTargetFlags.Residential | SetupTargetFlags.Service)) != 0;

Notes: - The enum is decorated with [Flags], so values are intended to be combined. - The underlying type is unsigned 32-bit (uint), allowing many distinct bit flags.