mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-08 21:05:34 +08:00
Upfront of refs #369
* consolidated ICoordinateGeodetic (e.g. fixed nested properties) * shifted common functionality for objects/containers with callsign into interface * shifted common functionality for objects/containers with geo position into interface * shifted common functionality for objects/containers with timestamp into interface * updated corresponding value objects / specialized lists * adjusted all places where renamed functions are used
This commit is contained in:
@@ -32,23 +32,6 @@ namespace BlackMisc
|
||||
CSequence<CAircraft>(other)
|
||||
{ }
|
||||
|
||||
/*
|
||||
* Contains callsign
|
||||
*/
|
||||
bool CAircraftList::containsCallsign(const CCallsign &callsign) const
|
||||
{
|
||||
if (callsign.isEmpty()) { return false; }
|
||||
return this->contains(&CAircraft::getCallsign, callsign);
|
||||
}
|
||||
|
||||
/*
|
||||
* Change for callsign
|
||||
*/
|
||||
int CAircraftList::applyIfCallsign(const CCallsign &callsign, const CPropertyIndexVariantMap &variantMap)
|
||||
{
|
||||
return this->applyIf(&CAircraft::getCallsign, callsign, variantMap, false);
|
||||
}
|
||||
|
||||
/*
|
||||
* Register metadata
|
||||
*/
|
||||
@@ -63,30 +46,6 @@ namespace BlackMisc
|
||||
registerMetaValueType<CAircraftList>();
|
||||
}
|
||||
|
||||
/*
|
||||
* Find by callsign
|
||||
*/
|
||||
CAircraftList CAircraftList::findByCallsign(const CCallsign &callsign) const
|
||||
{
|
||||
return this->findBy(&CAircraft::getCallsign, callsign);
|
||||
}
|
||||
|
||||
/*
|
||||
* Find by callsigns
|
||||
*/
|
||||
CAircraftList CAircraftList::findByCallsigns(const CCallsignList &callsigns) const
|
||||
{
|
||||
return this->findBy(Predicates::MemberIsAnyOf(&CAircraft::getCallsign, callsigns));
|
||||
}
|
||||
|
||||
/*
|
||||
* Find by callsign
|
||||
*/
|
||||
CAircraft CAircraftList::findFirstByCallsign(const CCallsign &callsign, const CAircraft &ifNotFound) const
|
||||
{
|
||||
return this->findByCallsign(callsign).frontOrDefault(ifNotFound);
|
||||
}
|
||||
|
||||
/*
|
||||
* All pilots
|
||||
*/
|
||||
@@ -95,17 +54,6 @@ namespace BlackMisc
|
||||
return this->findBy(Predicates::MemberValid(&CAircraft::getPilot)).transform(Predicates::MemberTransform(&CAircraft::getPilot));
|
||||
}
|
||||
|
||||
/*
|
||||
* Aircrafts within range
|
||||
*/
|
||||
CAircraftList CAircraftList::findWithinRange(const BlackMisc::Geo::ICoordinateGeodetic &coordinate, const PhysicalQuantities::CLength &range) const
|
||||
{
|
||||
return this->findBy([&](const CAircraft & aircraft)
|
||||
{
|
||||
return BlackMisc::Geo::greatCircleDistance(aircraft, coordinate) <= range;
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Merge with aircraft
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user