forked from organicmaps/organicmaps-tmp
Changing equality and relational criteria for gates.
This commit is contained in:
parent
775df60663
commit
d527b9746a
2 changed files with 23 additions and 2 deletions
|
@ -174,6 +174,26 @@ Gate::Gate(OsmId osmId, FeatureId featureId, bool entrance, bool exit, double we
|
|||
{
|
||||
}
|
||||
|
||||
bool Gate::operator<(Gate const & rhs) const
|
||||
{
|
||||
if (m_featureIdentifiers != rhs.m_featureIdentifiers)
|
||||
return m_featureIdentifiers < rhs.m_featureIdentifiers;
|
||||
|
||||
if (m_entrance != rhs.m_entrance)
|
||||
return m_entrance < rhs.m_entrance;
|
||||
|
||||
if (m_exit != rhs.m_exit)
|
||||
return m_exit < rhs.m_exit;
|
||||
|
||||
return m_stopIds < rhs.m_stopIds;
|
||||
}
|
||||
|
||||
bool Gate::operator==(Gate const & rhs) const
|
||||
{
|
||||
return m_featureIdentifiers == rhs.m_featureIdentifiers && m_entrance == rhs.m_entrance &&
|
||||
m_exit == rhs.m_exit && m_stopIds == rhs.m_stopIds;
|
||||
}
|
||||
|
||||
bool Gate::IsEqualForTesting(Gate const & gate) const
|
||||
{
|
||||
return m_featureIdentifiers == gate.m_featureIdentifiers &&
|
||||
|
|
|
@ -89,6 +89,7 @@ public:
|
|||
|
||||
bool operator<(FeatureIdentifiers const & rhs) const;
|
||||
bool operator==(FeatureIdentifiers const & rhs) const;
|
||||
bool operator!=(FeatureIdentifiers const & rhs) const { return !(*this == rhs); }
|
||||
bool IsValid() const;
|
||||
void SetOsmId(OsmId osmId) { m_osmId = osmId; }
|
||||
void SetFeatureId(FeatureId featureId) { m_featureId = featureId; }
|
||||
|
@ -194,8 +195,8 @@ public:
|
|||
Gate(OsmId osmId, FeatureId featureId, bool entrance, bool exit, double weight,
|
||||
std::vector<StopId> const & stopIds, m2::PointD const & point);
|
||||
|
||||
bool operator<(Gate const & rhs) const { return m_featureIdentifiers < rhs.m_featureIdentifiers; }
|
||||
bool operator==(Gate const & rhs) const { return m_featureIdentifiers == rhs.m_featureIdentifiers; }
|
||||
bool operator<(Gate const & rhs) const;
|
||||
bool operator==(Gate const & rhs) const;
|
||||
bool IsEqualForTesting(Gate const & gate) const;
|
||||
bool IsValid() const;
|
||||
void SetBestPedestrianSegment(SingleMwmSegment const & s) { m_bestPedestrianSegment = s; };
|
||||
|
|
Loading…
Add table
Reference in a new issue