Skip to content

Game.BatteryChargeNode

Assembly: Assembly-CSharp (game runtime assembly; actual assembly name may vary)
Namespace: Game.Simulation

Type: struct

Base: IComponentData, IQueryTypeParameter, IEmptySerializable

Summary:
BatteryChargeNode is an empty/tag component (1-byte sized) used with Unity's ECS in Cities: Skylines 2 to mark entities that represent battery charge nodes. It has no payload data; presence/absence is used to identify or query entities. The StructLayout attribute enforces a sequential layout with Size = 1 so the type occupies a single byte (useful for serialization and native layout expectations). Implementing IEmptySerializable indicates it participates in the game's/Colossal serialization as an empty marker.


Fields

  • This struct declares no instance fields.
    The StructLayout(Size = 1) attribute reserves 1 byte of storage even though no managed fields are present.

Properties

  • This struct exposes no properties.
    It is intended solely as a tag component used in queries and component lookups.

Constructors

  • public BatteryChargeNode() (implicit parameterless)
    As an empty value type, the default parameterless constructor is used to create the tag instance.

Methods

  • This type declares no methods.
    Behavior is provided via systems and queries that examine the presence of the component on entities.

Usage Example

// Add the tag to an entity
EntityManager.AddComponentData(entity, new BatteryChargeNode());

// Query entities that have the BatteryChargeNode tag
Entities
    .WithAll<BatteryChargeNode>()
    .ForEach((Entity e, in SomeOtherComponent comp) =>
    {
        // Handle battery charge node entity
    })
    .Schedule();