diff options
author | vng <viktor.govako@gmail.com> | 2012-01-27 15:07:33 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:32:31 +0300 |
commit | b84bc9172fdb5ed1ada0820eda43c655d22bf842 (patch) | |
tree | 512dc696db4196285fdddc4eb74062142898a9a2 /indexer/feature_utils.cpp | |
parent | f87031f54b1e60a7310efb5c2608fad6b62c27c8 (diff) |
Replace FeatureBase::GetTypesFn with more suitable feature::TypesHolder.
Diffstat (limited to 'indexer/feature_utils.cpp')
-rw-r--r-- | indexer/feature_utils.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/indexer/feature_utils.cpp b/indexer/feature_utils.cpp index 04f5719b73..6c19a577af 100644 --- a/indexer/feature_utils.cpp +++ b/indexer/feature_utils.cpp @@ -77,13 +77,12 @@ public: return limitR; } - FeatureBase::GetTypesFn types; - f.ForEachTypeRef(types); + feature::TypesHolder types(f); int const upperScale = scales::GetUpperScale(); int scale = upperScale; - for (size_t i = 0; i < types.m_size; ++i) - scale = min(scale, GetScaleForType(types.m_types[i], f)); + for (size_t i = 0; i < types.Size(); ++i) + scale = min(scale, GetScaleForType(types[i], f)); CorrectScaleForVisibility(f, scale); @@ -95,23 +94,23 @@ public: { uint32_t population = feature.GetPopulation(); - FeatureBase::GetTypesFn types; - feature.ForEachTypeRef(types); - for (size_t i = 0; i < types.m_size; ++i) + feature::TypesHolder types(feature); + + for (size_t i = 0; i < types.Size(); ++i) { - if (IsEqual(types.m_types[i], m_TypeSmallVillage)) + if (IsEqual(types[i], m_TypeSmallVillage)) population = max(population, static_cast<uint32_t>(100)); - else if (IsEqual(types.m_types[i], m_TypeVillage)) + else if (IsEqual(types[i], m_TypeVillage)) population = max(population, static_cast<uint32_t>(1000)); - else if (types.m_types[i] == m_TypeTown || IsEqual(types.m_types[i], m_TypeCounty)) + else if (types[i] == m_TypeTown || IsEqual(types[i], m_TypeCounty)) population = max(population, static_cast<uint32_t>(10000)); - else if (types.m_types[i] == m_TypeCity || types.m_types[i] == m_TypeState) + else if (types[i] == m_TypeCity || types[i] == m_TypeState) population = max(population, static_cast<uint32_t>(100000)); - else if (types.m_types[i] == m_TypeCityCapital) + else if (types[i] == m_TypeCityCapital) population = max(population, static_cast<uint32_t>(1000000)); - else if (types.m_types[i] == m_TypeCountry) + else if (types[i] == m_TypeCountry) population = max(population, static_cast<uint32_t>(2000000)); - else if (types.m_types[i] == m_TypeContinent) + else if (types[i] == m_TypeContinent) population = max(population, static_cast<uint32_t>(20000000)); } |