Skip to content

Game.Routes.RouteModifierType

Assembly: Assembly-CSharp.dll
Namespace: Game.Routes

Type: enum

Base: System.Enum

Summary:
Represents the kinds of modifiers that can be applied to a transit route. Currently the enum defines two modifier categories: - TicketPrice — modifies the fare charged for using the route. - VehicleInterval — modifies how frequently vehicles are dispatched on the route (interval between vehicles).

These values are used when applying or querying route adjustments in gameplay or mods to determine which route parameter should be changed.


Fields

  • TicketPrice
    Represents a modifier that affects the ticket/fare price for the route. The underlying integer value is 0. When applying this modifier, the associated value is typically a monetary amount (game currency) or a relative change to the existing fare.

  • VehicleInterval
    Represents a modifier that affects the dispatch interval of vehicles on the route. The underlying integer value is 1. When applying this modifier, the associated value is typically a time interval (seconds) or a multiplier that changes vehicle frequency.

Properties

  • This enum does not define instance properties. (It inherits the standard System.Enum behavior and members such as ToString(), HasFlag(), etc.)

Constructors

  • Enums have an implicit default constructor and underlying integer values. For RouteModifierType:
  • TicketPrice = 0
  • VehicleInterval = 1 You can cast from/to the underlying integer type (int) if needed.

Methods

  • The enum itself does not declare methods. Use standard System.Enum/static helpers when needed, for example:
  • Enum.GetNames(typeof(RouteModifierType))
  • Enum.TryParse(string, out var result)

Usage Example

// Example: applying a modifier to a route (pseudocode — replace with actual route API)
void ApplyRouteModifier(Route route, RouteModifierType modifierType, float value)
{
    switch (modifierType)
    {
        case RouteModifierType.TicketPrice:
            // Set the route fare (value interpreted as currency amount)
            route.TicketPrice = value;
            break;

        case RouteModifierType.VehicleInterval:
            // Set the interval between vehicles in seconds (or use the route API's expected units)
            route.VehicleInterval = value;
            break;
    }
}

// Example: parsing from int or string
int raw = 1;
var typeFromInt = (RouteModifierType)raw; // VehicleInterval
if (Enum.TryParse<RouteModifierType>("TicketPrice", out var parsed))
{
    // parsed == RouteModifierType.TicketPrice
}