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 25b0bccfd5
commit b9983add15
195 changed files with 991 additions and 947 deletions

View File

@ -18,7 +18,7 @@ using osu.Game.Online.Multiplayer;
using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
using osu.Game.Online.Rooms;
using osu.Game.Rulesets.Mods;
using osu.Game.Users;
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
namespace osu.Game.Tests.Visual.Multiplayer
{
@ -51,7 +51,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
public void Disconnect() => isConnected.Value = false;
public MultiplayerRoomUser AddUser(User user, bool markAsPlaying = false)
public MultiplayerRoomUser AddUser(APIUser user, bool markAsPlaying = false)
{
var roomUser = new MultiplayerRoomUser(user.Id) { User = user };
@ -73,7 +73,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
Scheduler.Update();
}
public void RemoveUser(User user)
public void RemoveUser(APIUser user)
{
Debug.Assert(Room != null);
((IMultiplayerClient)this).UserLeft(new MultiplayerRoomUser(user.Id));

View File

@ -3,10 +3,10 @@
using System;
using osu.Game.Beatmaps;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Rooms;
using osu.Game.Rulesets;
using osu.Game.Screens.OnlinePlay.Components;
using osu.Game.Users;
namespace osu.Game.Tests.Visual.OnlinePlay
{
@ -33,7 +33,7 @@ namespace osu.Game.Tests.Visual.OnlinePlay
{
RoomID = { Value = -currentRoomId },
Name = { Value = $@"Room {currentRoomId}" },
Host = { Value = new User { Username = @"Host" } },
Host = { Value = new APIUser { Username = @"Host" } },
EndDate = { Value = DateTimeOffset.Now + TimeSpan.FromSeconds(10) },
Category = { Value = i % 2 == 0 ? RoomCategory.Spotlight : RoomCategory.Normal },
};

View File

@ -7,11 +7,11 @@ using System.Linq;
using osu.Framework.Allocation;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Rooms;
using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring;
using osu.Game.Screens.OnlinePlay.Components;
using osu.Game.Users;
namespace osu.Game.Tests.Visual.OnlinePlay
{
@ -37,7 +37,7 @@ namespace osu.Game.Tests.Visual.OnlinePlay
/// <param name="localUser">The local user to store in responses where required.</param>
/// <param name="game">The game base for cases where actual online requests need to be sent.</param>
/// <returns>Whether the request was successfully handled.</returns>
public bool HandleRequest(APIRequest request, User localUser, OsuGameBase game)
public bool HandleRequest(APIRequest request, APIUser localUser, OsuGameBase game)
{
switch (request)
{

View File

@ -4,24 +4,24 @@
using System.Threading;
using System.Threading.Tasks;
using osu.Game.Database;
using osu.Game.Users;
using osu.Game.Online.API.Requests.Responses;
namespace osu.Game.Tests.Visual
{
public class TestUserLookupCache : UserLookupCache
{
/// <summary>
/// A special user ID which <see cref="ComputeValueAsync"/> would return a <see langword="null"/> <see cref="User"/> for.
/// A special user ID which <see cref="ComputeValueAsync"/> would return a <see langword="null"/> <see cref="APIUser"/> for.
/// As a simulation to what a regular <see cref="UserLookupCache"/> would return in the case of failing to fetch the user.
/// </summary>
public const int UNRESOLVED_USER_ID = -1;
protected override Task<User> ComputeValueAsync(int lookup, CancellationToken token = default)
protected override Task<APIUser> ComputeValueAsync(int lookup, CancellationToken token = default)
{
if (lookup == UNRESOLVED_USER_ID)
return Task.FromResult((User)null);
return Task.FromResult((APIUser)null);
return Task.FromResult(new User
return Task.FromResult(new APIUser
{
Id = lookup,
Username = $"User {lookup}"