[Kernel] AchievementManager: Added Interface for attaching custom implementations

This commit is contained in:
Gliniak
2024-12-10 19:13:47 +01:00
committed by Radosław Gliński
parent 0368e06b71
commit e93373660f
10 changed files with 423 additions and 82 deletions

View File

@@ -232,6 +232,31 @@ Property* UserProfile::GetProperty(const AttributeKey id) {
return nullptr;
}
AchievementGpdStructure* UserProfile::GetAchievement(const uint32_t title_id,
const uint32_t id) {
auto title_achievements = achievements_.find(title_id);
if (title_achievements == achievements_.end()) {
return nullptr;
}
for (auto& entry : title_achievements->second) {
if (entry.achievement_id == id) {
return &entry;
}
}
return nullptr;
}
std::vector<AchievementGpdStructure>* UserProfile::GetTitleAchievements(
const uint32_t title_id) {
auto title_achievements = achievements_.find(title_id);
if (title_achievements == achievements_.end()) {
return nullptr;
}
return &title_achievements->second;
}
} // namespace xam
} // namespace kernel
} // namespace xe