Skip to content

Game.Prefabs.InfoviewTransportStopData

Assembly:
Unknown (game assembly - provided by Cities: Skylines 2 game/mod SDK)

Namespace:
Game.Prefabs

Type:
struct

Base:
IComponentData, IQueryTypeParameter

Summary:
Component data used by the game's ECS to mark an entity as an infoview transport stop and to carry the transport stop's type. This is a small, blittable data component containing a single TransportType enum value. It is intended to be attached to transport-stop-related entities so systems that render infoview overlays or perform transport-stop logic can read the stop type efficiently.


Fields

  • public TransportType m_Type
    Holds the transport stop type (an enum). Typical TransportType values represent different modes of transport (for example: Bus, Tram, Metro, Train, Ferry, etc.). This field is the only payload of the component and is used by systems querying transport stops to decide rendering and behavior.

Properties

  • None
    This struct exposes no properties; it is a plain public-field data component.

Constructors

  • public InfoviewTransportStopData()
    The default parameterless constructor is provided implicitly (as for all C# structs). You can also initialize with an object initializer, e.g. new InfoviewTransportStopData { m_Type = TransportType.Bus }.

Methods

  • None
    This component defines no methods. It exists solely as an IComponentData / IQueryTypeParameter carrier.

Usage Example

// Add the component to an entity (EntityManager or SystemBase context)
var em = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity stopEntity = /* obtain or create entity representing a transport stop */;

em.AddComponentData(stopEntity, new InfoviewTransportStopData {
    m_Type = TransportType.Bus
});

// Example: querying entities with this component in a SystemBase
Entities
    .WithAll<InfoviewTransportStopData>()
    .ForEach((Entity e, in InfoviewTransportStopData stopData) =>
    {
        // Use stopData.m_Type to determine rendering/behavior for the infoview
    }).Schedule();

Notes: - Because the type implements IQueryTypeParameter it can be used directly in entity queries and for fast structural matching in ECS systems. - Keep the component minimal to allow burst-safe, high-performance iteration over transport-stop entities.