X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Frunways.cxx;h=84205a27620a9de91f27cf0e6c69170aa31d6bc7;hb=81cd33e2fa9b5930784d3aed920eea0e3038e7f7;hp=66f2407a2989d438321b4feea5022239e34108fe;hpb=88a4435cef38450fff9804c304c9132af79f854c;p=flightgear.git diff --git a/src/Airports/runways.cxx b/src/Airports/runways.cxx index 66f2407a2..84205a276 100644 --- a/src/Airports/runways.cxx +++ b/src/Airports/runways.cxx @@ -130,12 +130,12 @@ void FGRunway::setReciprocalRunway(PositionedID other) FGAirport* FGRunway::airport() const { - return (FGAirport*) flightgear::NavDataCache::instance()->loadById(_airport); + return loadById(_airport); } FGRunway* FGRunway::reciprocalRunway() const { - return (FGRunway*) flightgear::NavDataCache::instance()->loadById(_reciprocal); + return loadById(_reciprocal); } FGNavRecord* FGRunway::ILS() const @@ -144,7 +144,7 @@ FGNavRecord* FGRunway::ILS() const return NULL; } - return (FGNavRecord*) flightgear::NavDataCache::instance()->loadById(_ils); + return loadById(_ils); } FGNavRecord* FGRunway::glideslope() const @@ -155,13 +155,13 @@ FGNavRecord* FGRunway::glideslope() const return NULL; } - return (FGNavRecord*) cache->loadById(gsId); + return loadById(gsId); } -std::vector FGRunway::getSIDs() const +flightgear::SIDList FGRunway::getSIDs() const { FGAirport* apt = airport(); - std::vector result; + flightgear::SIDList result; for (unsigned int i=0; inumSIDs(); ++i) { flightgear::SID* s = apt->getSIDByIndex(i); if (s->isForRunway(this)) { @@ -172,10 +172,10 @@ std::vector FGRunway::getSIDs() const return result; } -std::vector FGRunway::getSTARs() const +flightgear::STARList FGRunway::getSTARs() const { FGAirport* apt = airport(); - std::vector result; + flightgear::STARList result; for (unsigned int i=0; inumSTARs(); ++i) { flightgear::STAR* s = apt->getSTARByIndex(i); if (s->isForRunway(this)) { @@ -186,13 +186,17 @@ std::vector FGRunway::getSTARs() const return result; } -std::vector FGRunway::getApproaches() const +flightgear::ApproachList +FGRunway::getApproaches(flightgear::ProcedureType type) const { FGAirport* apt = airport(); - std::vector result; - for (unsigned int i=0; inumApproaches(); ++i) { + flightgear::ApproachList result; + for (unsigned int i=0; inumApproaches(); ++i) + { flightgear::Approach* s = apt->getApproachByIndex(i); - if (s->runway() == this) { + if( s->runway() == this + && (type == flightgear::PROCEDURE_INVALID || type == s->type()) ) + { result.push_back(s); } } // of approaches at the airport iteration