Game.Vehicles.TaxiFlags
Assembly: Assembly-CSharp (game assembly / Assembly-CSharp.dll)
Namespace: Game.Vehicles
Type: public enum (with [Flags])
Base: System.Enum (underlying type: System.UInt32)
Summary:
Bit flags representing the current state and metadata of a taxi vehicle. Marked with the [Flags] attribute so multiple states can be combined into a single TaxiFlags value. Each named member is a distinct power-of-two value so they can be tested, combined, and cleared with bitwise operations.
Fields
-
Returning = 1u
Taxi is returning (likely to depot or home base). -
Requested = 2u
A taxi request has been made (a passenger requested a taxi or service queued). -
Arriving = 4u
Taxi is arriving at its destination or pickup point. -
Boarding = 8u
Passengers are boarding the taxi. -
Disembarking = 0x10u
(16)
Passengers are getting off the taxi. -
Transporting = 0x20u
(32)
Taxi is actively transporting passengers between origin and destination. -
RequiresMaintenance = 0x40u
(64)
Taxi requires maintenance (e.g., needs repair or servicing). -
Dispatched = 0x80u
(128)
Taxi has been dispatched (sent out to respond to a request). -
FromOutside = 0x100u
(256)
Taxi came from outside the city/simulation boundaries. -
Disabled = 0x200u
(512)
Taxi is disabled (out of service, possibly awaiting removal or repair).
Properties
- This enum defines no properties.
Constructors
- Enums do not define explicit constructors. TaxiFlags has the default enum behavior provided by System.Enum and can be cast to/from its underlying uint value.
Methods
- No methods are defined on the enum type itself. Use standard enum and bitwise operations to work with flags.
- Commonly used inherited/utility methods:
- ToString() — converts the flag value to a readable string (combined names when multiple flags present).
- Enum.HasFlag(Enum) — tests whether a particular flag is set (note: HasFlag can be slower due to boxing).
- You can and should use bitwise operators for performance-critical checks:
- (flags & TaxiFlags.SomeFlag) == TaxiFlags.SomeFlag
- flags |= TaxiFlags.SomeFlag // set
- flags &= ~TaxiFlags.SomeFlag // clear
- flags ^= TaxiFlags.SomeFlag // toggle
Usage Example
// Create a flag value and set a couple of states
TaxiFlags taxi = TaxiFlags.Dispatched | TaxiFlags.Transporting;
// Check whether the taxi is transporting (fast, non-boxing)
bool isTransporting = (taxi & TaxiFlags.Transporting) == TaxiFlags.Transporting;
// Add a flag
taxi |= TaxiFlags.RequiresMaintenance;
// Remove a flag
taxi &= ~TaxiFlags.Dispatched;
// Toggle a flag
taxi ^= TaxiFlags.Disabled;
// Converting to/from the underlying uint for storage/interop
uint raw = (uint)taxi;
taxi = (TaxiFlags)raw;
Notes: - Because TaxiFlags is decorated with [Flags], multiple states can be combined and represented in a single value. - Prefer bitwise checks over Enum.HasFlag in performance-sensitive code to avoid boxing overhead.