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

Class ContainsPoint

src/Savegame/SavedGame.cpp:1525–1534  ·  view source on GitHub ↗

@brief Check if a point is contained in a region. * This function object checks if a point is contained inside a region. */

Source from the content-addressed store, hash-verified

1523 * This function object checks if a point is contained inside a region.
1524 */
1525class ContainsPoint: public std::unary_function<const Region *, bool>
1526{
1527public:
1528 /// Remember the coordinates.
1529 ContainsPoint(double lon, double lat) : _lon(lon), _lat(lat) { /* Empty by design. */ }
1530 /// Check is the region contains the stored point.
1531 bool operator()(const Region *region) const { return region->getRules()->insideRegion(_lon, _lat); }
1532private:
1533 double _lon, _lat;
1534};
1535
1536/**
1537 * Find the region containing this location.

Callers 1

locateRegionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected