Skip to content

Game.Prefabs.RoadType

Assembly:
Game (the game's core assemblies containing prefab definitions)

Namespace:
Game.Prefabs

Type:
enum

Base:
System.Enum

Summary:
RoadType is a simple enumeration used by road prefabs to indicate the road's classification with respect to public transport. It helps systems and mod code decide whether a road supports public transport infrastructure (stops, lanes reserved for transit, route planning behavior, etc.). The default underlying type is int and the default value (0) corresponds to RoadType.Normal.


Fields

  • Normal
    Represents a standard road with no special public-transport designation. Typically used for ordinary vehicle traffic lanes and roads that do not host dedicated public-transport stops or features.

  • PublicTransport
    Indicates the road is intended to support public-transport services (buses, trams, etc.). Systems can use this flag to enable placement of stops, routing preferences, reserved lanes, or special rendering/overlay behavior.

Properties

  • This enum has no properties.
    (As a System.Enum-derived type, it inherits members such as ToString(), HasFlag(), etc.)

Constructors

  • No explicit constructors.
    Enums in C# have no user-defined constructors; the default value is the zero-valued member (here: RoadType.Normal).

Methods

  • No custom methods.
    Inherited methods from System.Enum / System.ValueType / System.Object are available (e.g., ToString(), GetValues(), HasFlag()).

Usage Example

// Example: checking road type to enable public-transport-specific logic
public class RoadBehaviour
{
    public RoadType roadType;

    public void ConfigureRoad()
    {
        if (roadType == RoadType.PublicTransport)
        {
            // enable stop placement, adjust lane priorities, etc.
            EnableStops();
        }
        else
        {
            // standard road behavior
            DisableStops();
        }
    }

    private void EnableStops() { /* implementation that registers stops or UI overlays */ }
    private void DisableStops() { /* implementation */ }
}

Notes: - Use this enum when defining or inspecting road prefabs to ensure consistent behavior across mods and the base game. - When persisting values (e.g., in save data or prefab config), store the enum value or its integer representation; the default numeric mapping here is Normal = 0, PublicTransport = 1.