diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2016-06-30 15:02:54 +0300 |
---|---|---|
committer | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2016-07-01 09:46:40 +0300 |
commit | cd6792e04d95b30d9f4669f59f08aa99794d4b11 (patch) | |
tree | cce644dfec69dc7be9b336ed1a921a6ad874a665 /indexer | |
parent | 517c506328c3e2c5504178cd59a65ddfc320b9cd (diff) |
Added displaying of hotel info if any hotel is selected
Diffstat (limited to 'indexer')
-rw-r--r-- | indexer/ftypes_matcher.cpp | 20 | ||||
-rw-r--r-- | indexer/ftypes_matcher.hpp | 9 |
2 files changed, 29 insertions, 0 deletions
diff --git a/indexer/ftypes_matcher.cpp b/indexer/ftypes_matcher.cpp index 7b1328e18f..20d03af41e 100644 --- a/indexer/ftypes_matcher.cpp +++ b/indexer/ftypes_matcher.cpp @@ -425,6 +425,26 @@ IsBookingChecker const & IsBookingChecker::Instance() return inst; } +IsHotelChecker::IsHotelChecker() +{ + Classificator const & c = classif(); + for (auto const & tag : GetHotelTags()) + m_types.push_back(c.GetTypeByPath({"tourism", tag})); +} + +IsHotelChecker const & IsHotelChecker::Instance() +{ + static const IsHotelChecker inst; + return inst; +} + +vector<string> const & IsHotelChecker::GetHotelTags() +{ + static vector<string> hotelTags = {"hotel", "apartment", "camp_site", "chalet", + "guest_house", "hostel", "motel", "resort"}; + return hotelTags; +} + uint32_t GetPopulation(FeatureType const & ft) { uint32_t population = ft.GetPopulation(); diff --git a/indexer/ftypes_matcher.hpp b/indexer/ftypes_matcher.hpp index 7f6dc48e30..16e80b813f 100644 --- a/indexer/ftypes_matcher.hpp +++ b/indexer/ftypes_matcher.hpp @@ -164,6 +164,15 @@ public: static IsBookingChecker const & Instance(); }; +class IsHotelChecker : public BaseChecker +{ + IsHotelChecker(); + +public: + static IsHotelChecker const & Instance(); + static vector<string> const & GetHotelTags(); +}; + /// Type of locality (do not change values and order - they have detalization order) /// COUNTRY < STATE < CITY < ... enum Type { NONE = -1, COUNTRY = 0, STATE, CITY, TOWN, VILLAGE, LOCALITY_COUNT }; |