- class PowerConnectableMixin(name: str, similar_entities: list[str], **kwargs: dict)
Enables the Entity to be connected to power networks.
- property maximum_wire_distance: float
The maximum distance that this entity can reach for power connections. Not exported; read only.
- property neighbours: list
The power pole neighbours that this entity connects to.
neighboursis traditionally specified as a list of
ints, each one representing the index of the entity in the parent blueprint that this Entity connects to, in 1-indexed notation. For example, if
entity.neighbours == [2, 3], then
entitywould have power wires to
blueprint.entities. If you’re importing from an already existing blueprint string, then this is the format you should expect.
Draftsman implements a more sophisticated neighbours format, where entities themselves (or rather, references to them) are used as the entries of the
neighbourslist. This makes connections independent of their location in the parent blueprint, so you can specify power connections even before you’ve placed all the entities in one. Draftsman uses this format when making connections, is still compatible with simple integers.
Int-based neighbours lists are fragile; if you want to preserve connections in integer format, you have to preserve entity order. Any new entities must be added to the end. Keep this in mind when importing an already-made blueprint string with connections already made.
Power switch wire connections are abnormal; they are not treated as neighbours and instead as special copper circuit connections. Inspect an Entity’s
connectionsattribute if you’re looking for those wires.