Add category getter for an achievement item.

This commit is contained in:
Bartosz Taudul 2024-06-08 13:44:11 +02:00
parent b38ac8bfef
commit 51ee66323b
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 8 additions and 0 deletions

View File

@ -136,6 +136,13 @@ data::AchievementCategory** AchievementsMgr::GetCategories() const
return data::AchievementCategories; return data::AchievementCategories;
} }
data::AchievementCategory* AchievementsMgr::GetCategoryForAchievement( const char* id ) const
{
auto it = m_map.find( id );
assert( it != m_map.end() );
return it->second.category;
}
data::AchievementItem* AchievementsMgr::GetNextQueue() data::AchievementItem* AchievementsMgr::GetNextQueue()
{ {
if( m_queue.empty() ) return nullptr; if( m_queue.empty() ) return nullptr;

View File

@ -61,6 +61,7 @@ public:
void Achieve( const char* id ); void Achieve( const char* id );
data::AchievementCategory** GetCategories() const; data::AchievementCategory** GetCategories() const;
data::AchievementCategory* GetCategoryForAchievement( const char* id ) const;
data::AchievementItem* GetNextQueue(); data::AchievementItem* GetNextQueue();
void PopQueue(); void PopQueue();