Game.GarbageProducerFlags
Assembly: Assembly-CSharp
Namespace: Game.Buildings
Type: enum (flags)
Base: System.Enum (underlying type: byte)
Summary: GarbageProducerFlags is a small flagged enumeration used by the building garbage/collection systems to represent state flags for garbage-producing buildings. It uses the [Flags] attribute and a byte underlying type to allow bitwise combination of values. Typical usage is to mark or query whether a building currently has a "garbage piling up" warning state.
Fields
-
None
= 0
Represents no flags set. -
GarbagePilingUpWarning
= 1
Indicates the building has a garbage piling-up warning (e.g., an overflow or unmet garbage collection demand).
Properties
- This enum type has no custom properties. Standard Enum members/methods (ToString, HasFlag, etc.) from System.Enum are available.
Constructors
- Enums do not define custom constructors in C#. There is no explicit constructor for this enum; values are assigned by casting integers to GarbageProducerFlags or by using the named members.
Methods
- There are no custom methods declared on this enum. Use the standard System.Enum/bitwise operations to manipulate and query flags:
- bitwise operators: &, |, ^, ~
- Enum.HasFlag (instance method)
- casting to/from byte: (byte)flags, (GarbageProducerFlags)someByte
Usage Example
// Set a flag
GarbageProducerFlags flags = GarbageProducerFlags.None;
flags |= GarbageProducerFlags.GarbagePilingUpWarning;
// Check a flag (recommended: bitwise check for performance in hot code)
if ((flags & GarbageProducerFlags.GarbagePilingUpWarning) != 0)
{
// handle garbage piling up warning
}
// Clear a flag
flags &= ~GarbageProducerFlags.GarbagePilingUpWarning;
// Cast to/from underlying byte for storage/transport
byte raw = (byte)flags;
GarbageProducerFlags restored = (GarbageProducerFlags)raw;