[Kernel] Added Property class and storing them for user

This commit is contained in:
Gliniak
2024-03-24 18:31:11 +01:00
parent eb785c8e35
commit 854b7df2ba
6 changed files with 243 additions and 13 deletions

View File

@@ -212,6 +212,30 @@ void UserProfile::SaveSetting(UserSetting* setting) {
}
}
bool UserProfile::AddProperty(const Property* property) {
// Find if property already exits
const Property* entry = GetProperty(property->GetPropertyId());
if (entry) {
entry = property;
return true;
}
properties_.push_back(*property);
return true;
}
const Property* UserProfile::GetProperty(const AttributeKey id) const {
for (auto& entry : properties_) {
if (entry.GetPropertyId().value != id.value) {
continue;
}
return &entry;
}
return nullptr;
}
} // namespace xam
} // namespace kernel
} // namespace xe