MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / locateRegion

Method locateRegion

src/Savegame/SavedGame.cpp:1542–1550  ·  view source on GitHub ↗

* Find the region containing this location. * @param lon The longtitude. * @param lat The latitude. * @return Pointer to the region, or 0. */

Source from the content-addressed store, hash-verified

1540 * @return Pointer to the region, or 0.
1541 */
1542Region *SavedGame::locateRegion(double lon, double lat) const
1543{
1544 std::vector<Region *>::const_iterator found = std::find_if(_regions.begin(), _regions.end(), ContainsPoint(lon, lat));
1545 if (found != _regions.end())
1546 {
1547 return *found;
1548 }
1549 return 0;
1550}
1551
1552/**
1553 * Find the region containing this target.

Callers 5

time10MinutesMethod · 0.80
processTerrorSiteMethod · 0.80
operator()Method · 0.80
moveMethod · 0.80

Calls 3

ContainsPointClass · 0.85
getLongitudeMethod · 0.45
getLatitudeMethod · 0.45

Tested by

no test coverage detected