Game.Buildings.MaintenanceDepotFlags
Assembly: Assembly-CSharp.dll
Namespace: Game.Buildings
Type: enum (public)
Base: System.Byte
Summary: MaintenanceDepotFlags is a small bitmask-style enum used to represent state flags for maintenance depots in Cities: Skylines 2. It is marked with [Flags], so individual values are intended to be combined with bitwise operators. The underlying storage type is byte, keeping the enum compact for tight memory usage in game data structures. Typical usage is to indicate whether a depot currently has available vehicles (and to extend later with additional flags if needed).
Fields
HasAvailableVehicles = 1
Indicates that the maintenance depot currently has at least one available vehicle. Because the enum has the [Flags] attribute, this value represents the least-significant bit and can be combined with other flags (if added later) using bitwise operators.
Properties
- This enum type has no properties. Use bitwise operators on values of this enum to test or modify flags.
Constructors
- This enum has no constructors (standard enum behavior). Values are created and cast as necessary, e.g.:
MaintenanceDepotFlags flags = MaintenanceDepotFlags.HasAvailableVehicles;
- or from a raw byte:
MaintenanceDepotFlags flags = (MaintenanceDepotFlags)rawByte;
Methods
- This enum type defines no methods. Use standard enum/bitwise operations (|, &, ~) and System.Enum helper methods if needed (e.g., Enum.HasFlag).
Usage Example
// Set a flag on a depot
MaintenanceDepotFlags flags = MaintenanceDepotFlags.HasAvailableVehicles;
// Check if the depot has available vehicles
if ((flags & MaintenanceDepotFlags.HasAvailableVehicles) != 0)
{
// depot has available vehicles
}
// Alternatively using Enum.HasFlag (slower, boxed):
if (flags.HasFlag(MaintenanceDepotFlags.HasAvailableVehicles))
{
// depot has available vehicles
}
// Clear the flag
flags &= ~MaintenanceDepotFlags.HasAvailableVehicles;
// Working with raw byte storage (cast to/from byte)
byte raw = (byte)flags;
flags = (MaintenanceDepotFlags)raw;