Rename User to APIUser and move to correct namespace

This commit is contained in:
Dean Herbert
2021-11-04 18:02:44 +09:00
parent 69aa620ab7
commit 0ecf5f201c
195 changed files with 990 additions and 946 deletions

View File

@ -11,8 +11,8 @@ using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Skinning;
using osu.Game.Users;
namespace osu.Game.Screens.Backgrounds
{
@ -22,7 +22,7 @@ namespace osu.Game.Screens.Backgrounds
private int currentDisplay;
private const int background_count = 7;
private IBindable<User> user;
private IBindable<APIUser> user;
private Bindable<Skin> skin;
private Bindable<BackgroundSource> mode;
private Bindable<IntroSequence> introSequence;

View File

@ -14,9 +14,9 @@ using osu.Framework.Utils;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses;
using osuTK;
using osuTK.Graphics;
using osu.Game.Users;
namespace osu.Game.Screens.Menu
{
@ -34,7 +34,7 @@ namespace osu.Game.Screens.Menu
private readonly OsuScreen nextScreen;
private readonly Bindable<User> currentUser = new Bindable<User>();
private readonly Bindable<APIUser> currentUser = new Bindable<APIUser>();
private FillFlowContainer fill;
private readonly List<ITextPart> expendableText = new List<ITextPart>();
@ -168,7 +168,7 @@ namespace osu.Game.Screens.Menu
if (nextScreen != null)
LoadComponentAsync(nextScreen);
((IBindable<User>)currentUser).BindTo(api.LocalUser);
((IBindable<APIUser>)currentUser).BindTo(api.LocalUser);
}
public override void OnEntering(IScreen last)

View File

@ -4,15 +4,15 @@
using osuTK.Graphics;
using osu.Game.Skinning;
using osu.Game.Online.API;
using osu.Game.Users;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Online.API.Requests.Responses;
namespace osu.Game.Screens.Menu
{
internal class MenuLogoVisualisation : LogoVisualisation
{
private IBindable<User> user;
private IBindable<APIUser> user;
private Bindable<Skin> skin;
[BackgroundDependencyLoader]

View File

@ -13,10 +13,10 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Skinning;
using osu.Game.Online.API;
using osu.Game.Users;
using System;
using osu.Framework.Audio.Track;
using osu.Framework.Bindables;
using osu.Game.Online.API.Requests.Responses;
namespace osu.Game.Screens.Menu
{
@ -35,7 +35,7 @@ namespace osu.Game.Screens.Menu
private const double box_fade_in_time = 65;
private const int box_width = 200;
private IBindable<User> user;
private IBindable<APIUser> user;
private Bindable<Skin> skin;
[Resolved]

View File

@ -7,7 +7,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Threading;
using osu.Game.Users;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Users.Drawables;
using osuTK;
@ -92,7 +92,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
private class UserTile : CompositeDrawable
{
public User User
public APIUser User
{
get => avatar.User;
set => avatar.User = value;

View File

@ -20,6 +20,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Chat;
using osu.Game.Online.Rooms;
using osu.Game.Overlays.BeatmapListing.Panels;
@ -27,7 +28,6 @@ using osu.Game.Overlays.BeatmapSet;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Screens.Play.HUD;
using osu.Game.Users;
using osuTK;
using osuTK.Graphics;
@ -122,7 +122,7 @@ namespace osu.Game.Screens.OnlinePlay
if (!string.IsNullOrEmpty(Item.Beatmap.Value?.Metadata.Author))
{
authorText.AddText("mapped by ");
authorText.AddUserLink(new User { Username = Item.Beatmap.Value.Metadata.Author });
authorText.AddUserLink(new APIUser { Username = Item.Beatmap.Value.Metadata.Author });
}
bool hasExplicitContent = (Item.Beatmap.Value.BeatmapSet as IBeatmapSetOnlineInfo)?.HasExplicitContent == true;

View File

@ -12,8 +12,8 @@ using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Overlays;
using osu.Game.Users;
using osu.Game.Users.Drawables;
using osuTK;
@ -195,12 +195,12 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
switch (e.Action)
{
case NotifyCollectionChangedAction.Add:
foreach (var added in e.NewItems.OfType<User>())
foreach (var added in e.NewItems.OfType<APIUser>())
addUser(added);
break;
case NotifyCollectionChangedAction.Remove:
foreach (var removed in e.OldItems.OfType<User>())
foreach (var removed in e.OldItems.OfType<APIUser>())
removeUser(removed);
break;
@ -222,13 +222,13 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
private int displayedCircles => avatarFlow.Count + (hiddenUsers.Count > 0 ? 1 : 0);
private void addUser(User user)
private void addUser(APIUser user)
{
if (displayedCircles < NumberOfCircles)
avatarFlow.Add(new CircularAvatar { User = user });
}
private void removeUser(User user)
private void removeUser(APIUser user)
{
avatarFlow.RemoveAll(a => a.User == user);
}
@ -256,7 +256,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
}
}
private void onHostChanged(ValueChangedEvent<User> host)
private void onHostChanged(ValueChangedEvent<APIUser> host)
{
hostAvatar.User = host.NewValue;
hostText.Clear();
@ -270,7 +270,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
private class CircularAvatar : CompositeDrawable
{
public User User
public APIUser User
{
get => avatar.User;
set => avatar.User = value;

View File

@ -8,10 +8,10 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Beatmaps.Drawables;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Rooms;
using osu.Game.Screens.OnlinePlay.Lounge.Components;
using osu.Game.Screens.OnlinePlay.Match.Components;
using osu.Game.Users;
using osuTK;
namespace osu.Game.Screens.OnlinePlay.Match
@ -24,7 +24,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
[Resolved]
private IAPIProvider api { get; set; }
private readonly IBindable<User> host = new Bindable<User>();
private readonly IBindable<APIUser> host = new Bindable<APIUser>();
private readonly bool allowEdit;
[CanBeNull]

View File

@ -6,9 +6,9 @@ using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Containers;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Rooms;
using osu.Game.Screens.OnlinePlay.Match;
using osu.Game.Users;
namespace osu.Game.Screens.OnlinePlay
{
@ -24,7 +24,7 @@ namespace osu.Game.Screens.OnlinePlay
protected Bindable<string> RoomName { get; private set; }
[Resolved(typeof(Room))]
protected Bindable<User> Host { get; private set; }
protected Bindable<APIUser> Host { get; private set; }
[Resolved(typeof(Room))]
protected Bindable<RoomStatus> Status { get; private set; }
@ -39,7 +39,7 @@ namespace osu.Game.Screens.OnlinePlay
protected Bindable<RoomCategory> Category { get; private set; }
[Resolved(typeof(Room))]
protected BindableList<User> RecentParticipants { get; private set; }
protected BindableList<APIUser> RecentParticipants { get; private set; }
[Resolved(typeof(Room))]
protected Bindable<int> ParticipantCount { get; private set; }

View File

@ -11,7 +11,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Containers;
using osu.Game.Users;
using osu.Game.Online.API.Requests.Responses;
using osuTK;
using osuTK.Graphics;
@ -75,7 +75,7 @@ namespace osu.Game.Screens.Play.HUD
/// Whether the player should be tracked on the leaderboard.
/// Set to <c>true</c> for the local player or a player whose replay is currently being played.
/// </param>
public ILeaderboardScore Add([CanBeNull] User user, bool isTracked)
public ILeaderboardScore Add([CanBeNull] APIUser user, bool isTracked)
{
var drawable = CreateLeaderboardScoreDrawable(user, isTracked);
@ -106,7 +106,7 @@ namespace osu.Game.Screens.Play.HUD
scroll.ScrollToStart(false);
}
protected virtual GameplayLeaderboardScore CreateLeaderboardScoreDrawable(User user, bool isTracked) =>
protected virtual GameplayLeaderboardScore CreateLeaderboardScoreDrawable(APIUser user, bool isTracked) =>
new GameplayLeaderboardScore(user, isTracked);
protected override void Update()

View File

@ -10,7 +10,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Users;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Users.Drawables;
using osu.Game.Utils;
using osuTK;
@ -79,7 +79,7 @@ namespace osu.Game.Screens.Play.HUD
}
[CanBeNull]
public User User { get; }
public APIUser User { get; }
/// <summary>
/// Whether this score is the local user or a replay player (and should be focused / always visible).
@ -101,7 +101,7 @@ namespace osu.Game.Screens.Play.HUD
/// </summary>
/// <param name="user">The score's player.</param>
/// <param name="tracked">Whether the player is the local user or a replay player.</param>
public GameplayLeaderboardScore([CanBeNull] User user, bool tracked)
public GameplayLeaderboardScore([CanBeNull] APIUser user, bool tracked)
{
User = user;
Tracked = tracked;

View File

@ -12,11 +12,11 @@ using osu.Game.Configuration;
using osu.Game.Database;
using osu.Game.Graphics;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Multiplayer;
using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
using osu.Game.Online.Spectator;
using osu.Game.Rulesets.Scoring;
using osu.Game.Users;
using osuTK.Graphics;
namespace osu.Game.Screens.Play.HUD
@ -118,7 +118,7 @@ namespace osu.Game.Screens.Play.HUD
protected virtual TrackedUserData CreateUserData(MultiplayerRoomUser user, ScoreProcessor scoreProcessor) => new TrackedUserData(user, scoreProcessor);
protected override GameplayLeaderboardScore CreateLeaderboardScoreDrawable(User user, bool isTracked)
protected override GameplayLeaderboardScore CreateLeaderboardScoreDrawable(APIUser user, bool isTracked)
{
var leaderboardScore = base.CreateLeaderboardScoreDrawable(user, isTracked);

View File

@ -27,6 +27,7 @@ using osu.Game.Screens.OnlinePlay.Match.Components;
using osu.Game.Screens.Spectate;
using osu.Game.Users;
using osuTK;
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
namespace osu.Game.Screens.Play
{
@ -34,7 +35,7 @@ namespace osu.Game.Screens.Play
public class SoloSpectator : SpectatorScreen, IPreviewTrackOwner
{
[NotNull]
private readonly User targetUser;
private readonly APIUser targetUser;
[Resolved]
private IAPIProvider api { get; set; }
@ -62,7 +63,7 @@ namespace osu.Game.Screens.Play
private APIBeatmapSet beatmapSet;
public SoloSpectator([NotNull] User targetUser)
public SoloSpectator([NotNull] APIUser targetUser)
: base(targetUser.Id)
{
this.targetUser = targetUser;

View File

@ -6,7 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Users;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Users.Drawables;
using osuTK;
@ -17,13 +17,13 @@ namespace osu.Game.Screens.Ranking.Expanded
/// </summary>
public class ExpandedPanelTopContent : CompositeDrawable
{
private readonly User user;
private readonly APIUser user;
/// <summary>
/// Creates a new <see cref="ExpandedPanelTopContent"/>.
/// </summary>
/// <param name="user">The <see cref="User"/> to display.</param>
public ExpandedPanelTopContent(User user)
/// <param name="user">The <see cref="APIUser"/> to display.</param>
public ExpandedPanelTopContent(APIUser user)
{
this.user = user;
Anchor = Anchor.TopCentre;

View File

@ -11,11 +11,11 @@ using osu.Framework.Bindables;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Spectator;
using osu.Game.Replays;
using osu.Game.Rulesets;
using osu.Game.Scoring;
using osu.Game.Users;
namespace osu.Game.Screens.Spectate
{
@ -42,7 +42,7 @@ namespace osu.Game.Screens.Spectate
private readonly IBindableDictionary<int, SpectatorState> playingUserStates = new BindableDictionary<int, SpectatorState>();
private readonly Dictionary<int, User> userMap = new Dictionary<int, User>();
private readonly Dictionary<int, APIUser> userMap = new Dictionary<int, APIUser>();
private readonly Dictionary<int, SpectatorGameplayState> gameplayStates = new Dictionary<int, SpectatorGameplayState>();
private IBindable<WeakReference<BeatmapSetInfo>> managerUpdated;