code: private static Map<Circuit, Collection<TileRef>> getCircuits(MapTile map)
      {
          final MapTileGroup mapGroup = map.getFeature(MapTileGroup.class);
          final Map<Circuit, Collection<TileRef>> circuits = new HashMap<>();
          final MapCircuitExtractor extractor = new MapCircuitExtractor(map);
          for (int ty = 1; ty < map.getInTileHeight() - 1; ty++)
          {
              for (int tx = 1; tx < map.getInTileWidth() - 1; tx++)
              {
                  final Tile tile = map.getTile(tx, ty);
                  if (tile != null && TileGroupType.CIRCUIT == mapGroup.getType(tile))
                  {
                      checkCircuit(circuits, extractor, map, tile);
                  }
              }
          }
          return circuits;
      }
docs: Get map tile circuits.
  
  @param map The map reference.
  @return The circuits found with their associated tiles.