Game.Routes.RouteType
Assembly:
Assembly-CSharp (game runtime assembly; typical for Cities: Skylines 2)
Namespace: Game.Routes
Type:
enum
Base:
System.Enum (underlying type: System.Int32)
Summary:
Defines the kinds of routes tracked by the game's routing system. Provides a sentinel for "no route" (None), concrete route categories used by gameplay (TransportLine, WorkRoute), and a Count entry useful for iteration/validation.
Fields
-
None = -1
Represents an invalid or uninitialized route type. Use this as a sentinel value when no route is assigned. -
TransportLine = 0
A route associated with public transport lines (buses, trams, etc.). Internally has the integer value 0. -
WorkRoute = 1
A route used for work/service vehicles or job-related routing. Internally has the integer value 1. -
Count = 2
Represents the number of defined route types (excludes None). Useful for bounds checking or iterating over valid route types (0 .. Count-1).
Properties
—
This enum does not define any properties.
Constructors
—
Enums do not declare explicit constructors. The named constants above are the available values.
Methods
—
No custom methods are defined on this enum. Standard Enum methods (ToString, CompareTo, etc.) are available from System.Enum.
Usage Example
// Typical use: store route type on a route object
RouteType route = RouteType.TransportLine;
// Check for valid route
if (route == RouteType.None) {
// handle uninitialized route
}
// Switch behaviour by route type
switch (route) {
case RouteType.TransportLine:
// handle transport line logic
break;
case RouteType.WorkRoute:
// handle work route logic
break;
}
// Iterate over valid route types
for (int i = 0; i < (int)RouteType.Count; i++) {
RouteType t = (RouteType)i;
// process t
}
// When serializing or storing as integer:
int raw = (int)route; // -1, 0, 1, or 2