Add GetPopulation() to feature.

This commit is contained in:
Yury Melnichek 2011-05-30 20:26:55 +02:00 committed by Alex Zolotarev
parent cce07a6ae2
commit e5f3ddf1c6
2 changed files with 9 additions and 0 deletions

View file

@ -981,3 +981,11 @@ uint8_t FeatureType::GetRank() const
return m_Params.rank;
}
uint32_t FeatureType::GetPopulation() const
{
uint8_t const rank = GetRank();
if (rank == 0)
return 1;
return static_cast<uint32_t>(min(double(uint32_t(-1)), pow(1.1, rank)));
}

View file

@ -377,6 +377,7 @@ public:
string DebugString(int scale) const;
uint8_t GetRank() const;
uint32_t GetPopulation() const;
/// @name Statistic functions.
//@{