MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / squareSearch

Function squareSearch

src/OpenLoco/src/World/Town.cpp:1499–1513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1497 // 0x00463BD2
1498 template<typename Func>
1499 static void squareSearch(const World::Pos2& centre, [[maybe_unused]] uint8_t searchSize, Func&& predicate)
1500 {
1501 assert(searchSize == 9);
1502 for (auto& offset : kSquareSearchRange<9>)
1503 {
1504 const World::Pos2 pos = World::toWorldSpace(offset) + centre;
1505 if (World::validCoords(pos))
1506 {
1507 if (!predicate(pos))
1508 {
1509 return;
1510 }
1511 }
1512 }
1513 }
1514
1515 struct RoadExtentResult
1516 {

Callers 2

findRoadExtentFunction · 0.85
buildInitialRoadFunction · 0.85

Calls 2

toWorldSpaceFunction · 0.85
validCoordsFunction · 0.85

Tested by

no test coverage detected