Game.Routes.TramStop
Assembly:
Namespace: Game.Routes
Type: struct
Base: System.ValueType, IComponentData, IQueryTypeParameter, IEmptySerializable
Summary:
TramStop is a marker/tag component used with Unity's Entities (ECS) in Cities: Skylines 2. It is an empty, serializable component that identifies an entity as a tram stop. The struct is laid out with a fixed size of 1 byte (via StructLayout) to ensure a non-zero footprint for serialization/storage systems that may not handle zero-sized types. Implementing IComponentData makes it usable in ECS component arrays; IQueryTypeParameter allows it to be used in query building helpers; IEmptySerializable (from Colossal.Serialization.Entities) marks it as safe for the game's custom serialization pipeline.
Fields
This struct declares no fields. It is intentionally empty and used only as a tag/marker.
Properties
This struct declares no properties.
Constructors
- No explicit constructors are defined. As a value type it has the implicit default parameterless constructor.
Methods
This struct declares no methods.
Usage Example
// Add the TramStop tag to an entity
entityManager.AddComponentData(entity, new TramStop());
// Query for all entities that are tram stops in a SystemBase
Entities
.WithAll<TramStop>()
.ForEach((Entity e) =>
{
// handle tram stop entity
}).Schedule();
Additional notes: - Attribute: [StructLayout(LayoutKind.Sequential, Size = 1)] — ensures the type has a defined size (1 byte), useful for interop/serialization and to avoid zero-sized-component edge cases. - This component carries no data; use it when you only need to mark or filter entities (for example, to find or tag tram stops).