Skip to content

Game.Objects.WaterPipeOutsideConnection

Assembly:
Assembly-CSharp (game/main assembly; may appear in mod assemblies as well)

Namespace: Game.Objects

Type:
struct

Base:
Implements: IComponentData, IQueryTypeParameter, IEmptySerializable

Summary:
This is an empty/tag ECS component used to mark an entity as an "outside" connection point for a water pipe (i.e., a connection to the external water network). The type is a zero-data marker: it carries no fields and is used solely for identification in queries and archetypes. The StructLayout attribute (LayoutKind.Sequential, Size = 1) ensures the struct has a non-zero size for serialization and interop purposes and to satisfy the game's/custom serializer requirements (Colossal.Serialization.Entities).


Fields

  • This struct contains no instance fields.
    It is intentionally an empty/tag component. The [StructLayout(LayoutKind.Sequential, Size = 1)] attribute is applied so the type has size 1 byte for serialization/interoperability even though it holds no data.

Properties

  • This component exposes no properties.
    It is only used as a marker/tag through the ECS API.

Constructors

  • public WaterPipeOutsideConnection()
    There is no explicit constructor defined; the default parameterless struct constructor applies. Use the default value (new WaterPipeOutsideConnection()) when adding the tag to an entity.

Methods

  • This type defines no methods.
    Behavior is provided by systems that query for the presence of this component on entities.

Usage Example

// Add the tag to an entity using the EntityManager
var em = World.DefaultGameObjectInjectionWorld.EntityManager;
var archetype = em.CreateArchetype(typeof(WaterPipeOutsideConnection), typeof(Translation), /* other components */);
var entity = em.CreateEntity(archetype);

// Or add the tag to an existing entity
em.AddComponentData(entity, new WaterPipeOutsideConnection());

// Query for entities that have the outside-connection tag
Entities
    .WithAll<WaterPipeOutsideConnection>()
    .ForEach((Entity e /*, other components */) =>
    {
        // Handle outside connection entity
    }).ScheduleParallel();

{{ Additional notes: - Because this component is empty, treat it as a pure tag: don't attempt to store per-entity state in it. - IQueryTypeParameter support allows it to be used directly in queries to filter entities. - IEmptySerializable is present to integrate correctly with the game's/custom serialization pipeline (Colossal.Serialization.Entities). - If you need to store per-connection metadata later (e.g., capacity, flow), create a separate component with fields rather than expanding this tag. }}