Skip to content

Game.Vehicles.EvacuatingTransport

Assembly:
Assembly-CSharp

Namespace:
Game.Vehicles

Type:
struct

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

Summary:
EvacuatingTransport is an empty/tag ECS component used to mark vehicle entities that are in an "evacuating transport" state. The struct is intentionally empty (no data) and marked with a StructLayout specifying Size = 1 so it has a non-zero size for serialization/interoperability purposes. It can be used as a marker in DOTS queries and for serialization with Colossal's systems.


Fields

  • None.
    This type contains no fields; it is a marker/flag component.

Attributes / Layout

  • [StructLayout(LayoutKind.Sequential, Size = 1)]
    Ensures the type occupies at least 1 byte in memory/serialization, which can be required by some serializers or native interop even for empty types.

Interfaces

  • IComponentData
    Marks the struct as an ECS component that can be attached to entities.

  • IQueryTypeParameter
    Allows the type to be used as a parameter in queries (e.g., Entities.WithAll<...>() or other query APIs).

  • IEmptySerializable
    Indicates the type participates in Colossal's serialization pipeline as an empty/marker serializable type.

Properties

  • None.
    There are no properties on this type.

Constructors

  • Implicit default constructor (value-type default)
    No explicit constructors are defined. Use the default instance (new EvacuatingTransport()) when adding the component.

Methods

  • None.
    No methods are defined on this marker component.

Usage Example

using Unity.Entities;
using Game.Vehicles;

// Adding the marker to an entity
EntityManager em = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity vehicleEntity = /* obtain or create the vehicle entity */;
em.AddComponentData(vehicleEntity, new EvacuatingTransport());

// Removing the marker when evacuation ends
em.RemoveComponent<EvacuatingTransport>(vehicleEntity);

// Querying entities that are evacuating
Entities
    .WithAll<EvacuatingTransport>()
    .ForEach((Entity e) =>
    {
        // handle evacuating vehicle
    }).Schedule();

Notes: - Because this is an empty marker component, it is typically used only to identify or filter entities in systems and does not carry per-entity data. - The Size = 1 layout attribute ensures compatibility with serialization and native expectations even though the struct itself contains no fields.