Game.Vehicles.MaintenanceVehicleFlags
Assembly: Assembly-CSharp (game runtime)
Namespace: Game.Vehicles
Type: public enum (flags)
Base: System.UInt32
Summary:
A bitmask (Flags) enum representing the various runtime states and conditions for maintenance vehicles (e.g., garbage trucks, road maintenance vehicles) in the game. Each enum value is a single bit so multiple states can be combined and tested using bitwise operations. These flags are used by vehicle logic to track behaviors such as whether the vehicle is returning to base, currently working, full, or disabled.
Fields
-
Returning = 1u
Indicates the vehicle is returning (typically to depot or base). -
TransformTarget = 2u
Marks that the vehicle has a transform target (a target transform or entity to follow/align to). -
EdgeTarget = 4u
Indicates the vehicle is targeting a road/edge segment. -
TryWork = 8u
A request/intent to attempt to perform work (e.g., begin a job). Often used as a check before switching to actual working state. -
Working = 0x10u
(16)
The vehicle is actively performing its assigned work. -
ClearingDebris = 0x20u
(32)
The vehicle is specifically clearing debris (a subtype of working). -
Full = 0x40u
(64)
The vehicle is full (e.g., garbage truck capacity reached). -
EstimatedFull = 0x80u
(128)
The vehicle is estimated to become full soon (prediction used for routing/decisions). -
Disabled = 0x100u
(256)
The vehicle is disabled (not available for normal tasks, possibly under repair or deactivated). -
ClearChecked = 0x200u
(512)
A marker indicating some "clear" condition has been checked; used to avoid repeated checks.
Properties
- (none)
This enum type does not declare properties.
Constructors
- (none / implicit)
Enums do not have explicit constructors in usage. Values are created/assigned by using the enum values or bitwise combinations thereof.
Methods
- (none)
The enum itself defines no methods. Use standard bitwise operators or Enum/extension helpers to work with these flags.
Usage Example
// Set flags: mark vehicle as Working and EdgeTarget
MaintenanceVehicleFlags flags = MaintenanceVehicleFlags.Working | MaintenanceVehicleFlags.EdgeTarget;
// Test a flag (recommended: bitwise test for performance)
bool isWorking = (flags & MaintenanceVehicleFlags.Working) == MaintenanceVehicleFlags.Working;
// Add a flag
flags |= MaintenanceVehicleFlags.ClearingDebris;
// Remove a flag
flags &= ~MaintenanceVehicleFlags.EdgeTarget;
// Check if vehicle is full
bool isFull = (flags & MaintenanceVehicleFlags.Full) == MaintenanceVehicleFlags.Full;
// Example: if vehicle is estimated to be full or already full, plan return
if ((flags & (MaintenanceVehicleFlags.Full | MaintenanceVehicleFlags.EstimatedFull)) != 0)
{
flags |= MaintenanceVehicleFlags.Returning;
}
Notes: - Because this enum is decorated with [Flags], combine and test values using bitwise operators. Avoid Enum.HasFlag in tight loops for performance-sensitive code (bitwise tests are faster). - Keep in mind values represent state bits — a vehicle can have multiple of these flags set simultaneously.