1
0
Fork 0

rename FGAirportSearchFilter::acceptable() -> ::pass()

This commit is contained in:
mfranz 2007-10-11 07:53:17 +00:00
parent 602e41bab6
commit 06c7c3c0f4
4 changed files with 6 additions and 5 deletions

View file

@ -197,14 +197,14 @@ FGAirport* FGAirportList::search(double lon_deg, double lat_deg)
// search for the airport nearest the specified position and
// passing the filter
FGAirport* FGAirportList::search(double lon_deg, double lat_deg,
FGAirportSearchFilter& search)
FGAirportSearchFilter& filter)
{
double min_dist = 360.0;
airport_list_iterator it = airports_array.begin();
airport_list_iterator end = airports_array.end();
airport_list_iterator closest = end;
for (; it != end; ++it) {
if (!search.acceptable(*it))
if (!filter.pass(*it))
continue;
// crude manhatten distance based on lat/lon difference

View file

@ -109,7 +109,8 @@ private:
class FGAirportSearchFilter {
public:
virtual ~FGAirportSearchFilter() {}
virtual bool acceptable(FGAirport*) { return true; }
// all airports pass the filter by default
virtual bool pass(FGAirport*) { return true; }
};

View file

@ -42,7 +42,7 @@
SG_USING_STD(sort);
class metar_filter : public FGAirportSearchFilter {
virtual bool acceptable(FGAirport *a) { return a->getMetar(); }
virtual bool pass(FGAirport *a) { return a->getMetar(); }
} metar_only;

View file

@ -487,7 +487,7 @@ static naRef f_geodinfo(naContext c, naRef me, int argc, naRef* args)
class airport_filter : public FGAirportSearchFilter {
virtual bool acceptable(FGAirport *a) { return a->isAirport(); }
virtual bool pass(FGAirport *a) { return a->isAirport(); }
} airport;
// Returns airport data for given airport id ("KSFO"), or for the airport