Skip to content

Game.Routes.AirplaneStop

Assembly:
Assembly-CSharp (game assembly)

Namespace:
Game.Routes

Type:
struct

Base:
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter, Colossal.Serialization.Entities.IEmptySerializable

Summary:
A lightweight tag component used to mark ECS entities that represent airplane stops (air route stops) in the game's routing system. The struct is empty but has an explicit layout and size to ensure it occupies one byte for native/container compatibility and for serialization support.


Fields

  • This struct contains no managed fields. It is an empty/tag component.
    The type is declared with [StructLayout(LayoutKind.Sequential, Size = 1)] so the runtime/native representation is 1 byte in size (important for certain native containers, serialization and interoperability).

Properties

  • None. This is a pure tag component (no readable/writable properties).

Constructors

  • Default parameterless constructor (implicit)
    As an empty struct there is no custom constructor defined; the default value (all-zero / single-byte) is used.

Methods

  • None. The struct only serves as a marker/tag and does not provide behavior.

Remarks (additional info)

  • Purpose: Use this component to tag entities as airplane stops so they can be selected in queries or matched by systems that operate on air route infrastructure.
  • Size attribute: The [StructLayout(LayoutKind.Sequential, Size = 1)] attribute forces the struct to occupy one byte instead of being a true zero-sized type. This is important in some DOTS/native scenarios (native arrays, serialization, and interop) where a zero-sized type can be problematic.
  • Interfaces:
  • IComponentData: Makes it a Unity ECS component.
  • IQueryTypeParameter: Allows the type to be used conveniently in some query patterns.
  • IEmptySerializable: Indicates support for Colossal's serialization expectations for empty components (used by the game's custom serialization pipeline).

Usage Example

// Tag an entity as an airplane stop when creating it
var entity = entityManager.CreateEntity();
entityManager.AddComponentData(entity, new Game.Routes.AirplaneStop());

// Querying for airplane stops in a system
Entities
    .WithAll<Game.Routes.AirplaneStop>()
    .ForEach((Entity e) =>
    {
        // e is an airplane stop entity
    }).Schedule();