mirror of
https://github.com/ppy/osu
synced 2024-12-21 14:23:00 +00:00
Add UserProfile
model to be used in user profile overlay
As `APIUser` implements `IEquatable`, attempting to replace an `APIUser` with another `APIUser` with the same online ID has no effect on the user profile overlay. This is a significant hurdle in implementing support for viewing the profile for different rulesets, as in that case the profile is basically reloaded for the same user, but slightly different data. To facilitate this, wrap `APIUser` in a new `UserProfile` class. This will mean that the equality rules can be changed locally to the user profile overlay without impacting other components that depend on the `APIUser` equality rules. The ruleset that the user profile is being displayed with will eventually be added to `UserProfile`, too.
This commit is contained in:
parent
53cc71c2fe
commit
608d8ee7d4
25
osu.Game/Overlays/Profile/UserProfile.cs
Normal file
25
osu.Game/Overlays/Profile/UserProfile.cs
Normal file
@ -0,0 +1,25 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Overlays.Profile
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains data about a profile presented on the <see cref="UserProfileOverlay"/>.
|
||||
/// </summary>
|
||||
public class UserProfile
|
||||
{
|
||||
/// <summary>
|
||||
/// The user whose profile is being presented.
|
||||
/// </summary>
|
||||
public APIUser User { get; }
|
||||
|
||||
// TODO: add ruleset
|
||||
|
||||
public UserProfile(APIUser user)
|
||||
{
|
||||
User = user;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user