Skip to content

Game.Buildings.TransportStationFlags

Assembly:
Namespace: Game.Buildings

Type: public enum

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

Summary: TransportStationFlags is a small flags enum (underlying byte) used to represent state bits for transport stations in the game. It is decorated with the [Flags] attribute, so values are intended to be combined using bitwise operations. Currently it defines a single flag, TransportStopsActive, which indicates that the station's transport stops are active (e.g., passengers can board/alight). This enum is typically used when reading/writing building state or when checking/updating transport-related state in mods.


Fields

  • TransportStopsActive = 1 Used to mark that the transport stops at a station are active. Because the enum is flagged, this bit can be combined with other bits if the enum is extended in the future. When set, it typically means the station's stops are functioning/available.

Properties

  • This enum type has no properties. Use bitwise operations to query or modify flags.

Constructors

  • This enum has no custom constructors. As with all enums, values can be created by casting from the underlying byte type:
  • TransportStationFlags flags = (TransportStationFlags)someByteValue;

Methods

  • This enum has no methods defined. Use standard enum/bitwise operations:
  • Check: (flags & TransportStationFlags.TransportStopsActive) != 0
  • Set: flags |= TransportStationFlags.TransportStopsActive
  • Clear: flags &= ~TransportStationFlags.TransportStopsActive

Usage Example

// Read from stored byte (for example, from building data)
byte stored = /* read from data */;
TransportStationFlags flags = (TransportStationFlags)stored;

// Check if stops are active
bool stopsActive = (flags & TransportStationFlags.TransportStopsActive) != 0;

// Enable the stops
flags |= TransportStationFlags.TransportStopsActive;

// Disable the stops
flags &= ~TransportStationFlags.TransportStopsActive;

// Write back to storage
byte toStore = (byte)flags;