rename FGAirportSearchFilter::acceptable() -> ::pass()
This commit is contained in:
parent
602e41bab6
commit
06c7c3c0f4
4 changed files with 6 additions and 5 deletions
|
@ -197,14 +197,14 @@ FGAirport* FGAirportList::search(double lon_deg, double lat_deg)
|
||||||
// search for the airport nearest the specified position and
|
// search for the airport nearest the specified position and
|
||||||
// passing the filter
|
// passing the filter
|
||||||
FGAirport* FGAirportList::search(double lon_deg, double lat_deg,
|
FGAirport* FGAirportList::search(double lon_deg, double lat_deg,
|
||||||
FGAirportSearchFilter& search)
|
FGAirportSearchFilter& filter)
|
||||||
{
|
{
|
||||||
double min_dist = 360.0;
|
double min_dist = 360.0;
|
||||||
airport_list_iterator it = airports_array.begin();
|
airport_list_iterator it = airports_array.begin();
|
||||||
airport_list_iterator end = airports_array.end();
|
airport_list_iterator end = airports_array.end();
|
||||||
airport_list_iterator closest = end;
|
airport_list_iterator closest = end;
|
||||||
for (; it != end; ++it) {
|
for (; it != end; ++it) {
|
||||||
if (!search.acceptable(*it))
|
if (!filter.pass(*it))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// crude manhatten distance based on lat/lon difference
|
// crude manhatten distance based on lat/lon difference
|
||||||
|
|
|
@ -109,7 +109,8 @@ private:
|
||||||
class FGAirportSearchFilter {
|
class FGAirportSearchFilter {
|
||||||
public:
|
public:
|
||||||
virtual ~FGAirportSearchFilter() {}
|
virtual ~FGAirportSearchFilter() {}
|
||||||
virtual bool acceptable(FGAirport*) { return true; }
|
// all airports pass the filter by default
|
||||||
|
virtual bool pass(FGAirport*) { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
SG_USING_STD(sort);
|
SG_USING_STD(sort);
|
||||||
|
|
||||||
class metar_filter : public FGAirportSearchFilter {
|
class metar_filter : public FGAirportSearchFilter {
|
||||||
virtual bool acceptable(FGAirport *a) { return a->getMetar(); }
|
virtual bool pass(FGAirport *a) { return a->getMetar(); }
|
||||||
} metar_only;
|
} metar_only;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -487,7 +487,7 @@ static naRef f_geodinfo(naContext c, naRef me, int argc, naRef* args)
|
||||||
|
|
||||||
|
|
||||||
class airport_filter : public FGAirportSearchFilter {
|
class airport_filter : public FGAirportSearchFilter {
|
||||||
virtual bool acceptable(FGAirport *a) { return a->isAirport(); }
|
virtual bool pass(FGAirport *a) { return a->isAirport(); }
|
||||||
} airport;
|
} airport;
|
||||||
|
|
||||||
// Returns airport data for given airport id ("KSFO"), or for the airport
|
// Returns airport data for given airport id ("KSFO"), or for the airport
|
||||||
|
|
Loading…
Add table
Reference in a new issue