Skip to content

Game.Buildings.GarbageFacilityFlags

Assembly: Assembly-CSharp
Namespace: Game.Buildings

Type: public enum GarbageFacilityFlags : byte

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

Summary: Flags enum used to represent the state and capabilities of a garbage facility in Cities: Skylines 2. The enum is marked with [Flags], so members can be combined bitwise to express multiple simultaneous states (for example, a facility can be both full and restricted to industrial waste). Typical uses include checking whether trucks or delivery capacity are available, whether the facility accepts only industrial waste, and whether the facility is currently full.


Fields

  • HasAvailableGarbageTrucks This flag (value = 1, 0x01) indicates that the facility currently has at least one garbage truck available to collect waste.

  • HasAvailableSpace This flag (value = 2, 0x02) indicates that the facility has free storage capacity to accept more garbage.

  • IndustrialWasteOnly This flag (value = 4, 0x04) indicates that the facility accepts only industrial waste (not general residential/commercial waste).

  • IsFull This flag (value = 8, 0x08) indicates that the facility is full and cannot accept more garbage.

  • HasAvailableDeliveryTrucks This flag (value = 16, 0x10) indicates that the facility has delivery trucks available (for example, for transporting processed materials or performing deliveries).

Properties

  • This enum type does not define instance properties. Use System.Enum helpers or bitwise operations to query or manipulate flag values.

Constructors

  • Enums in C# do not have user-defined constructors. Instances of GarbageFacilityFlags are created by assigning one of the defined values or combining them with bitwise operators. The default value (0) represents no flags set.

Methods

  • No custom methods are defined on this enum. Standard System.Enum methods (e.g., ToString, HasFlag, Parse) are available.

Usage Example

// Example: combining flags
GarbageFacilityFlags flags = GarbageFacilityFlags.HasAvailableGarbageTrucks | GarbageFacilityFlags.HasAvailableSpace;

// Check if a specific flag is set
bool hasTrucks = (flags & GarbageFacilityFlags.HasAvailableGarbageTrucks) != 0;
// or using Enum.HasFlag (slower by boxing on enums not of type Enum in some contexts)
bool hasSpace = flags.HasFlag(GarbageFacilityFlags.HasAvailableSpace);

// Set a flag
flags |= GarbageFacilityFlags.HasAvailableDeliveryTrucks;

// Clear a flag
flags &= ~GarbageFacilityFlags.HasAvailableSpace;

// Test for multiple flags (both set)
bool readyForDispatch = (flags & (GarbageFacilityFlags.HasAvailableGarbageTrucks | GarbageFacilityFlags.HasAvailableDeliveryTrucks)) 
                        == (GarbageFacilityFlags.HasAvailableGarbageTrucks | GarbageFacilityFlags.HasAvailableDeliveryTrucks);

// Example: Respecting IndustrialOnly restriction
if ((flags & GarbageFacilityFlags.IndustrialWasteOnly) != 0) {
    // route only industrial waste to this facility
}