mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 00:09:55 +09:00
Rename User
to APIUser
and move to correct namespace
This commit is contained in:
@ -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}"
|
||||
|
Reference in New Issue
Block a user