From a35256f8e791dda8e5e343de8483efc75d83ef58 Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Wed, 8 Jun 2016 16:40:35 +0300 Subject: Renaming tag bicycle_bidir to bidir_bicycle and other review fixes. --- routing/pedestrian_model.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'routing/pedestrian_model.cpp') 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); } -- cgit v1.2.3