Game.Routes.ShipStop
Assembly: Assembly-CSharp (game code / modding environment)
Namespace: Game.Routes
Type: struct
Base: IComponentData, IQueryTypeParameter, IEmptySerializable
Summary:
ShipStop is an empty marker/component struct used with Unity's ECS in Cities: Skylines 2 to tag entities representing ship stops (ports/harbor stops) on route systems. It is deliberately empty and marked with a fixed size via StructLayout to ensure a non-zero footprint for serialization/interoperability and to work correctly with the game's custom serializer. Implementing IComponentData makes it a Unity ECS component; IQueryTypeParameter allows it to be used in query declarations; IEmptySerializable indicates it is treated as an optimized empty-serializable type by Colossal's serialization utilities.
Fields
- This struct declares no instance fields. It is intentionally empty (marker component).
Properties
- This struct exposes no properties.
Constructors
public ShipStop()
(implicit default)
The struct uses the compiler-generated parameterless constructor. No custom construction logic is required.
Methods
- This struct declares no methods.
Additional notes: - The attribute [StructLayout(LayoutKind.Sequential, Size = 1)] forces the struct to occupy 1 byte, avoiding zero-sized-type issues with some serialization/interop paths. - Because it's an empty, blittable value type, it is efficient to add/remove in bulk and safe to use in Burst-compatible jobs and standard ECS queries.
Usage Example
// Add the marker to an existing entity using EntityManager
entityManager.AddComponentData(myEntity, new ShipStop());
// Or using an EntityCommandBuffer in a system
ecb.AddComponent<ShipStop>(entity);
// Querying for ship stops in a SystemBase
Entities
.WithAll<ShipStop>()
.ForEach((Entity e, in Translation pos) =>
{
// handle ship stop entity
})
.Schedule();
{{ This empty marker is intended solely for tagging entities as ship stops. Use it when you need to identify or filter route/transport entities that represent ship stops without carrying additional per-entity data. }}