@brief Match a mission based on region and type. * This function object will match alien missions based on region and type. */
| 1427 | * This function object will match alien missions based on region and type. |
| 1428 | */ |
| 1429 | class matchRegionAndType: public std::unary_function<AlienMission *, bool> |
| 1430 | { |
| 1431 | public: |
| 1432 | /// Store the region and type. |
| 1433 | matchRegionAndType(const std::string ®ion, const std::string &type) : _region(region), _type(type) { } |
| 1434 | /// Match against stored values. |
| 1435 | bool operator()(const AlienMission *mis) const |
| 1436 | { |
| 1437 | return mis->getRegion() == _region && mis->getType() == _type; |
| 1438 | } |
| 1439 | private: |
| 1440 | |
| 1441 | const std::string &_region; |
| 1442 | const std::string &_type; |
| 1443 | }; |
| 1444 | |
| 1445 | /** |
| 1446 | * Find a mission from the active alien missions. |