@brief Match a base from it's coordinates. * This function object uses coordinates to match a base. */
| 338 | * This function object uses coordinates to match a base. |
| 339 | */ |
| 340 | class MatchBaseCoordinates: public std::unary_function<const Base *, bool> |
| 341 | { |
| 342 | public: |
| 343 | /// Remember the query coordinates. |
| 344 | MatchBaseCoordinates(double lon, double lat) : _lon(lon), _lat(lat) { /* Empty by design. */ } |
| 345 | /// Match with base's coordinates. |
| 346 | bool operator()(const Base *base) const { return AreSame(base->getLongitude(), _lon) && AreSame(base->getLatitude(), _lat); } |
| 347 | private: |
| 348 | double _lon, _lat; |
| 349 | }; |
| 350 | |
| 351 | /** |
| 352 | * This function is called when one of the mission's UFOs arrives at it's current destination. |