Skip to content

Game.Buildings.PostFacilityFlags

Assembly: Game
Namespace: Game.Buildings

Type: public enum (with [Flags] attribute)

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

Summary: PostFacilityFlags is a flagged enum that describes capabilities and runtime availability/state for postal facilities in the game (e.g., whether the facility can deliver or collect mail by van, whether it has trucks available, and which types of mail it accepts/delivers). The [Flags] attribute and byte underlying type allow efficient bitwise combination and storage of multiple capabilities in a single byte value.


Fields

  • CanDeliverMailWithVan = 1 This flag indicates the facility can perform mail deliveries using a van.

  • CanCollectMailWithVan = 2 This flag indicates the facility can collect mail using a van.

  • HasAvailableTrucks = 4 Indicates that the facility currently has trucks available for operations (useful for runtime availability checks).

  • AcceptsUnsortedMail = 8 Indicates the facility accepts unsorted mail (incoming).

  • DeliversLocalMail = 0x10 Indicates the facility delivers local mail (outgoing local deliveries).

  • AcceptsLocalMail = 0x20 Indicates the facility accepts local mail (incoming local mail).

  • DeliversUnsortedMail = 0x40 Indicates the facility delivers unsorted mail (outgoing unsorted deliveries).

Note: No explicit zero value (None) is defined in the enum; the default value (0) therefore represents "no capabilities/flags set."

Properties

  • None.
    This enum does not define properties; it is intended to be used as a bitmask via bitwise operations or Enum.HasFlag.

Constructors

  • None (implicit).
    Enums do not expose custom constructors. The implicit default value for the enum type is 0 (no flags set).

Methods

  • None declared on the enum type.
    Use standard bitwise operations or System.Enum.HasFlag to query and modify flag combinations at runtime.

Usage Example

// Combine flags
PostFacilityFlags flags = PostFacilityFlags.CanDeliverMailWithVan | PostFacilityFlags.HasAvailableTrucks;

// Check a flag (bitwise)
bool canDeliverWithVan = (flags & PostFacilityFlags.CanDeliverMailWithVan) != 0;

// Check a flag (HasFlag)
bool hasTrucks = flags.HasFlag(PostFacilityFlags.HasAvailableTrucks);

// Add a flag
flags |= PostFacilityFlags.AcceptsUnsortedMail;

// Remove a flag
flags &= ~PostFacilityFlags.HasAvailableTrucks;

// Example: test for either local delivery or unsorted delivery
bool deliversLocalOrUnsorted = (flags & (PostFacilityFlags.DeliversLocalMail | PostFacilityFlags.DeliversUnsortedMail)) != 0;