Game.Buildings.ParkingFacilityFlags
Assembly: Assembly-CSharp (common for game types / modding)
Namespace: Game.Buildings
Type: public enum (flags)
Base: System.Enum (underlying type: System.Byte)
Summary: ParkingFacilityFlags is a small bitmask enum used by parking facility building code to track boolean states related to parking spaces. It is decorated with [Flags] so multiple values can be combined into a single byte value. The enum uses a byte as its underlying storage to minimize memory usage in building data structures.
Fields
ParkingSpacesActive = 1
Used to indicate that parking spaces for the facility are currently active/enabled. When set, systems (AI, rendering, or occupancy logic) can treat parking spaces as available/operational. Because the enum has the [Flags] attribute, this bit can be combined with other future flags in the same byte.
Properties
- (none)
This enum type defines no properties. It is a plain flags enum; any interaction is done via bitwise operations or casting.
Constructors
- (none — enums do not define constructors)
Enum values are defined as named constants. To create or store values, cast between the enum and its underlying byte type as needed.
Methods
- (none — no custom methods defined)
Standard System.Enum methods (ToString, HasFlag, etc.) are available. Typical usage is via bitwise operators or the built-in HasFlag method for readability.
Usage Example
// Read flags stored as a byte (for example in a building data structure)
byte stored = buildingData.parkingFlags;
var flags = (Game.Buildings.ParkingFacilityFlags)stored;
// Check whether parking spaces are active
if ((flags & Game.Buildings.ParkingFacilityFlags.ParkingSpacesActive) != 0)
{
// parking spaces are active
}
// Alternatively using HasFlag (slower due to boxing for enums on some runtimes)
if (flags.HasFlag(Game.Buildings.ParkingFacilityFlags.ParkingSpacesActive))
{
// parking spaces are active
}
// Set the flag
flags |= Game.Buildings.ParkingFacilityFlags.ParkingSpacesActive;
// Clear the flag
flags &= ~Game.Buildings.ParkingFacilityFlags.ParkingSpacesActive;
// Store back as a byte
buildingData.parkingFlags = (byte)flags;
Notes: - Because the underlying type is byte, cast to/from byte when persisting to compact building data structures. - Keep in mind bitwise checks are the most efficient for hot code paths in game logic.