(the region is the red area)
The region is placed so that it connects each button with a door. We can write the button's New() proc so that it uses the region to find what door it's associated with:
turf
button
var
turf/door/door
New()
..()
door = region.get(src, /turf/door)
Entered()
door.open()
The region.get() proc takes two arguments. The first is the source atom. The second is an object type to search for. The get() proc returns an instance of the specified type that resides in the same connected component of the region. Because it only looks in the part of the region that's connected to the source atom, we can use this same region type to create groupings between many pairs of buttons and doors.
Additionally, I wonder if there's a feasible way to get regions to behave like areas do graphically. Maybe you could show a these relationships between the switches and their doors on the map, like a trail of wiring.