Interface ElectricalDevice


public interface ElectricalDevice
A stationary electrical device exposed through the WWPG block capability.

providerId is a namespaced registration ID and slotId identifies the single device or whole assembly returned by this block's capability. Both remain stable across restarts. This API does not discover multiple simultaneous capability owners at one position; nested components use distinct local node and element IDs, or their native CEE panel and Power Grid circuit-board integration. terminals is a read-only geometry query available without preparing a circuit; implementations return an immutable snapshot and never modify world or electrical state from this method. Server preparation returns captured immutable inputs and does not advance history. WWPG calls commit once per participating server tick, including invalid results when a circuit cannot be solved.

The add-on owns gameplay, synchronization, and serialization. Persist the committed electricalState snapshots with the native block data. Restore those values into initial model inputs when reconstructing elements. Initial values are used only for creation/restoration; unchanged element IDs retain runtime history through parameter edits. Commit must apply gameplay only to valid results; invalid results are never previous readings or artificial zeroes.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Consume accepted results once; save committed history and update native gameplay.
    Capture circuit topology and parameters for the supplied authoritative tick.
    Stable namespaced provider ID, such as example:machine.
    default String
    Stable identity slot for the capability's single device or whole assembly.
    Immutable external terminal geometry snapshot; no electrical advancement.
  • Method Details

    • providerId

      String providerId()
      Stable namespaced provider ID, such as example:machine.
    • slotId

      default String slotId()
      Stable identity slot for the capability's single device or whole assembly.
    • terminals

      List<Terminal> terminals()
      Immutable external terminal geometry snapshot; no electrical advancement.
    • prepare

      CircuitDescription prepare(TickContext context)
      Capture circuit topology and parameters for the supplied authoritative tick.
    • commit

      void commit(DeviceResults results)
      Consume accepted results once; save committed history and update native gameplay.