Skip to content

Game.Simulation.ElectricityFlowNode

Assembly: Assembly-CSharp
Namespace: Game.Simulation

Type: struct

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

Summary:
A lightweight DOTS component used by the electricity simulation to represent a node in the electricity flow graph. It stores an integer index that identifies the node within the simulation's internal data structures. As an IComponentData it can be attached to entities and used in ECS queries; implementing IEmptySerializable indicates it is compatible with the game's custom serialization system.


Fields

  • public int m_Index
    Index value for this electricity flow node. This integer is used by the simulation to map the component to the internal node/table for electricity flow calculations. Set to 0 by default for newly constructed structs.

Properties

  • None.
    This type exposes its data directly via the public field m_Index.

Constructors

  • Default struct constructor (implicit)
    As a plain value-type struct there is no explicit constructor in source; initialize with the default or via object initializer: new ElectricityFlowNode { m_Index = }.

Methods

  • None.
    The struct contains no methods. Behavior is provided by systems that read/write this component.

Usage Example

// Create and attach the component to an entity using an EntityManager
var nodeComponent = new ElectricityFlowNode { m_Index = 42 };
entityManager.AddComponentData(someEntity, nodeComponent);

// Example: set or update the index on an existing entity
var existing = entityManager.GetComponentData<ElectricityFlowNode>(someEntity);
existing.m_Index = 100;
entityManager.SetComponentData(someEntity, existing);

{{ NOTES }}