Game.Routes.StopFlags
Assembly: Assembly-CSharp (in-game)
Namespace: Game.Routes
Type: public enum (marked with [Flags])
Base: System.Enum (underlying type: System.Int32)
Summary:
A bitwise flag enum used by the routing/stop system to record simple boolean states for a stop. Flags can be combined using bitwise operations to represent multiple boolean settings in a single value. Typical uses are checking if a stop is currently active/enabled and whether entities are allowed to enter the stop.
Fields
-
Active = 1
Represents that the stop is active/enabled. When set, the stop is considered operational. Use bitwise checks to test this flag. -
AllowEnter = 2
Indicates that vehicles/agents are allowed to enter the stop. When this flag is not set, the stop may refuse entry even if it is active.
Properties
- None.
This is a simple enum type; it does not expose properties.
Constructors
- None (enum types do not expose constructors).
The enum values are constant and there is no runtime constructor to create specialized instances beyond assignment/casting.
Methods
- None provided on the enum type itself.
Use .HasFlag, bitwise &, or comparisons to work with values.
Usage Example
// Combine flags
StopFlags flags = StopFlags.Active | StopFlags.AllowEnter;
// Check flags (bitwise)
bool isActive = (flags & StopFlags.Active) != 0;
bool canEnter = (flags & StopFlags.AllowEnter) != 0;
// Or use HasFlag (convenience, slightly slower)
bool canEnter2 = flags.HasFlag(StopFlags.AllowEnter);
// Remove a flag
flags &= ~StopFlags.AllowEnter; // now AllowEnter is cleared
// Set a flag
flags |= StopFlags.AllowEnter;
// Store/compare as integer if needed
int raw = (int)flags;