Skip to content

Game.Buildings.ExtractorFlags

Assembly: Assembly-CSharp (game core)
Namespace: Game.Buildings

Type: enum (flags)

Base: System.Enum (underlying type: byte)

Summary:
ExtractorFlags is a small flags enum used by extractor-type buildings to represent simple boolean states (for example whether the extractor is rotating or currently working). The [Flags] attribute allows combining values with bitwise operations and storing the enum compactly as a byte.


Fields

  • Rotating = 1
    Represents that the extractor has its rotating animation/mechanism active.

  • Working = 2
    Represents that the extractor is currently performing its work/operations (producing resources, active state).

(These values can be combined, e.g. Rotating | Working means the extractor is both rotating and working.)

Properties

  • (none)
    This enum does not define any properties.

Constructors

  • (none, enums have implicit constructors)
    The default value (0) indicates no flags set.

Methods

  • (none)
    No methods are defined on the enum type itself. Use bitwise operators or Enum helper methods to inspect/manipulate values.

Usage Example

// Combine flags
ExtractorFlags flags = ExtractorFlags.Rotating | ExtractorFlags.Working;

// Check a flag (recommended: bitwise check is faster than Enum.HasFlag)
bool isWorking = (flags & ExtractorFlags.Working) != 0;

// Set a flag
flags |= ExtractorFlags.Working;

// Clear a flag
flags &= ~ExtractorFlags.Rotating;

// Toggle a flag
flags ^= ExtractorFlags.Rotating;

// Convert to/from byte (compact storage)
byte raw = (byte)flags;
ExtractorFlags fromRaw = (ExtractorFlags)raw;

{{ This enum is intended for lightweight state storage for extractor buildings. Prefer explicit bitwise checks ((flags & X) != 0) in performance-sensitive code paths rather than Enum.HasFlag, and cast to/from byte when serializing or storing in compact structures. }}