diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2016-06-08 16:40:35 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2016-06-17 19:36:52 +0300 |
commit | a35256f8e791dda8e5e343de8483efc75d83ef58 (patch) | |
tree | da337897bd2627751162751056ffb76dfc9392b9 /routing/pedestrian_model.cpp | |
parent | 97a2bab208945d75de78fd07527084e7d34b3b8c (diff) |
Renaming tag bicycle_bidir to bidir_bicycle and other review fixes.
Diffstat (limited to 'routing/pedestrian_model.cpp')
-rw-r--r-- | routing/pedestrian_model.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/routing/pedestrian_model.cpp b/routing/pedestrian_model.cpp index 26147ec7ba..9e30abd9ee 100644 --- a/routing/pedestrian_model.cpp +++ b/routing/pedestrian_model.cpp @@ -633,23 +633,23 @@ void PedestrianModel::Init() SetAdditionalRoadTypes(classif(), arr, ARRAY_SIZE(arr)); } -VehicleModel::Restriction PedestrianModel::IsNoFoot(feature::TypesHolder const & types) const +VehicleModel::Restriction PedestrianModel::IsPedestrianAllowed(feature::TypesHolder const & types) const { - return types.Has(m_noFootType) ? Restriction::Yes : Restriction::Unknown; -} - -VehicleModel::Restriction PedestrianModel::IsYesFoot(feature::TypesHolder const & types) const -{ - return types.Has(m_yesFootType) ? Restriction::Yes : Restriction::Unknown; + if (types.Has(m_yesFootType)) + return Restriction::Yes; + if (types.Has(m_noFootType)) + return Restriction::No; + return Restriction::Unknown; } double PedestrianModel::GetSpeed(FeatureType const & f) const { feature::TypesHolder const types(f); - if (IsYesFoot(types) == Restriction::Yes) + Restriction const restriction = IsPedestrianAllowed(types); + if (restriction == Restriction::Yes) return VehicleModel::GetMaxSpeed(); - if (IsNoFoot(types) == Restriction::Unknown && HasRoadType(types)) + if (restriction != Restriction::No && HasRoadType(types)) return VehicleModel::GetMinTypeSpeed(types); return 0.0; @@ -662,8 +662,9 @@ bool PedestrianModel::IsRoad(FeatureType const & f) const feature::TypesHolder const types(f); - if (IsNoFoot(types) == Restriction::Yes) + if (IsPedestrianAllowed(types) == Restriction::No) return false; + return VehicleModel::HasRoadType(types); } |