Skip to content

Game.Prefabs.TransportStopMarkerData

Assembly:
Assembly-CSharp (may vary between game/mod builds)

Namespace:
Game.Prefabs

Type:
public struct TransportStopMarkerData : IComponentData, IQueryTypeParameter

Base:
System.ValueType
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter

Summary:
A lightweight ECS component used as a marker on transport stop prefabs. It identifies the transport mode for a stop and flags for two variant stop types (A and B). This struct is intended for use with the Unity Entities (DOTS) workflow in Cities: Skylines 2 modding — it is stored on entities representing transport stop markers and can be used in EntityQueries or systems to filter and configure stop behavior or visuals.


Fields

  • public TransportType m_TransportType
    Specifies the transport mode this stop marker corresponds to. TransportType is an enum (defined elsewhere in the codebase) representing modes such as bus, tram, train, metro, ferry, etc. Use this to distinguish behavior, routing, or visuals by transport mode.

  • public bool m_StopTypeA
    Flag indicating this stop uses "Type A" variant. The meaning of Type A is defined by the prefab/system that reads this component (for example, a particular platform shape, anchor, or layout). True = variant A enabled.

  • public bool m_StopTypeB
    Flag indicating this stop uses "Type B" variant. Similar to m_StopTypeA but for the alternative variant B. Both flags can be used independently; interpretation depends on consuming systems or prefab logic.

Properties

  • None

Constructors

  • public TransportStopMarkerData() (implicit struct default)
    As a value type, it has an implicit default constructor initializing m_TransportType to its default enum value and booleans to false. You can also initialize via an object initializer to set desired values.

Methods

  • None

Usage Example

// Create and add the component to an entity (EntityManager approach)
var marker = new TransportStopMarkerData
{
    m_TransportType = TransportType.Bus,
    m_StopTypeA = true,
    m_StopTypeB = false
};

entityManager.AddComponentData(stopEntity, marker);

// Querying entities that have this component in a system
Entities
    .WithAll<TransportStopMarkerData>()
    .ForEach((Entity e, in TransportStopMarkerData tsm) =>
    {
        // Inspect tsm.m_TransportType / tsm.m_StopTypeA / tsm.m_StopTypeB
    }).Schedule();

Notes: - Because this struct implements IQueryTypeParameter, it is intended to be used as part of entity queries or filtering in DOTS systems. - The exact semantics for StopTypeA/StopTypeB and the full set of TransportType values depend on other parts of the game's codebase and prefab definitions. Adjust usage according to those definitions.