Skip to content

Game.Routes.SubwayStop

Assembly: Assembly-CSharp (game assembly)
Namespace: Game.Routes

Type: struct

Base: System.ValueType

Summary:
SubwayStop is an empty/tag component used by the game's ECS to mark entities that represent subway stops. It is declared with a fixed layout and Size = 1 to ensure the struct occupies a byte in memory (avoiding zero-sized-type issues in native containers). It implements IComponentData so it can be attached to entities, IQueryTypeParameter to be used conveniently in entity queries, and IEmptySerializable to participate correctly in the game's custom serialization pipeline.


Fields

  • This struct declares no instance fields. It is intentionally empty and used as a tag/component marker.
    Implementation detail: StructLayout(LayoutKind.Sequential, Size = 1) forces a 1-byte size.

Properties

  • This type exposes no properties. It functions purely as a marker-type component.

Constructors

  • public SubwayStop()
    The default struct constructor is available. Use new SubwayStop() when adding the tag component to an entity (most code will simply pass a default value).

Methods

  • This type defines no methods. Its behavior is entirely passive — other systems and systems' queries react to the presence of the component.

Usage Example

// Add the SubwayStop tag to an existing entity using the EntityManager
entityManager.AddComponentData(entity, new Game.Routes.SubwayStop());

// Query for all entities that have the SubwayStop tag
Entities
    .WithAll<Game.Routes.SubwayStop>()
    .ForEach((Entity e) =>
    {
        // operate on subway stop entities
    });

// Alternatively, using an EntityQuery
var subwayStopQuery = entityManager.CreateEntityQuery(typeof(Game.Routes.SubwayStop));

Additional notes: - Because the struct is empty, it is intended purely as a tag; do not store per-stop data here. Associate any stop-specific data in separate components. - IEmptySerializable and Colossal.Serialization.Entities usage indicates this tag participates in the game's save/load serialization; do not remove or rename it without considering compatibility with saved game data and existing systems.