MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / scanConnectors

Method scanConnectors

source/game/StarDungeonGenerator.cpp:831–849  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

829 }
830
831 void Part::scanConnectors() {
832 try {
833 m_reader->forEachTile([this](Vec2I position, Tile const& tile) -> bool {
834 if (tile.connector.isValid()) {
835 auto d = tile.connector->direction;
836 if (d == Direction::Unknown)
837 d = pickByNeighbours(position);
838 if (d == Direction::Unknown)
839 d = pickByEdge(position, m_size);
840 Logger::debug("Found connector on {} at {} group {} direction {}", m_name, position, tile.connector->value, (int)d);
841 m_connections.append(make_shared<Connector>(this, tile.connector->value, tile.connector->forwardOnly, d, position));
842 }
843
844 return false;
845 });
846 } catch (std::exception& e) {
847 throw DungeonException(strf("Exception {} in connector {}", outputException(e, true), m_name));
848 }
849 }
850
851 void Part::scanAnchor() {
852 int cx, cy, cc;

Callers

nothing calls this directly

Calls 5

strfFunction · 0.85
isValidMethod · 0.80
outputExceptionFunction · 0.50
forEachTileMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected