mirror of
https://github.com/ppy/osu
synced 2024-12-27 09:23:15 +00:00
Update usages of APIUser
to RealmUser
This commit is contained in:
parent
213d89b479
commit
fda529de26
@ -3,7 +3,7 @@
|
||||
|
||||
using NUnit.Framework;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Models;
|
||||
|
||||
namespace osu.Game.Tests.Beatmaps
|
||||
{
|
||||
@ -34,7 +34,7 @@ namespace osu.Game.Tests.Beatmaps
|
||||
{
|
||||
Artist = "artist",
|
||||
Title = "title",
|
||||
Author = new APIUser { Username = "creator" }
|
||||
Author = new RealmUser { Username = "creator" }
|
||||
}
|
||||
};
|
||||
|
||||
@ -50,7 +50,7 @@ namespace osu.Game.Tests.Beatmaps
|
||||
{
|
||||
Artist = "artist",
|
||||
Title = "title",
|
||||
Author = new APIUser { Username = "creator" }
|
||||
Author = new RealmUser { Username = "creator" }
|
||||
},
|
||||
DifficultyName = "difficulty"
|
||||
};
|
||||
|
@ -17,7 +17,7 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Models;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
@ -305,7 +305,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
Artist = "Artist",
|
||||
Author = new APIUser { Username = "Creator name here" },
|
||||
Author = new RealmUser { Username = "Creator name here" },
|
||||
Title = "Long title used to check background colour",
|
||||
},
|
||||
BeatmapSet = new BeatmapSetInfo()
|
||||
|
@ -12,7 +12,7 @@ using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Models;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
@ -33,7 +33,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
[Test]
|
||||
public void TestMapWithKnownMapper()
|
||||
{
|
||||
var author = new APIUser { Username = "mapper_name" };
|
||||
var author = new RealmUser { Username = "mapper_name" };
|
||||
|
||||
AddStep("show example score", () => showPanel(TestResources.CreateTestScoreInfo(createTestBeatmap(author))));
|
||||
}
|
||||
@ -43,7 +43,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
{
|
||||
AddStep("show excess mods score", () =>
|
||||
{
|
||||
var author = new APIUser { Username = "mapper_name" };
|
||||
var author = new RealmUser { Username = "mapper_name" };
|
||||
|
||||
var score = TestResources.CreateTestScoreInfo(createTestBeatmap(author));
|
||||
score.Mods = score.BeatmapInfo.Ruleset.CreateInstance().CreateAllMods().ToArray();
|
||||
@ -57,7 +57,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
[Test]
|
||||
public void TestMapWithUnknownMapper()
|
||||
{
|
||||
AddStep("show example score", () => showPanel(TestResources.CreateTestScoreInfo(createTestBeatmap(new APIUser()))));
|
||||
AddStep("show example score", () => showPanel(TestResources.CreateTestScoreInfo(createTestBeatmap(new RealmUser()))));
|
||||
|
||||
AddAssert("mapped by text not present", () =>
|
||||
this.ChildrenOfType<OsuSpriteText>().All(spriteText => !containsAny(spriteText.Text.ToString(), "mapped", "by")));
|
||||
@ -73,7 +73,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
var ruleset = new OsuRuleset();
|
||||
|
||||
var mods = new Mod[] { ruleset.GetAutoplayMod() };
|
||||
var beatmap = createTestBeatmap(new APIUser());
|
||||
var beatmap = createTestBeatmap(new RealmUser());
|
||||
|
||||
var score = TestResources.CreateTestScoreInfo(beatmap);
|
||||
|
||||
@ -89,7 +89,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
private void showPanel(ScoreInfo score) =>
|
||||
Child = new ExpandedPanelMiddleContentContainer(score);
|
||||
|
||||
private BeatmapInfo createTestBeatmap([NotNull] APIUser author)
|
||||
private BeatmapInfo createTestBeatmap([NotNull] RealmUser author)
|
||||
{
|
||||
var beatmap = new TestBeatmap(rulesetStore.GetRuleset(0)).BeatmapInfo;
|
||||
|
||||
|
@ -17,6 +17,7 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Models;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Leaderboards;
|
||||
using osu.Game.Overlays;
|
||||
@ -65,7 +66,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
{
|
||||
Title = "TestSong",
|
||||
Artist = "TestArtist",
|
||||
Author = new APIUser
|
||||
Author = new RealmUser
|
||||
{
|
||||
Username = "TestAuthor"
|
||||
},
|
||||
|
@ -18,6 +18,7 @@ using osu.Framework.Testing;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.IO;
|
||||
using osu.Game.IO.Archives;
|
||||
using osu.Game.Models;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
@ -73,7 +74,11 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
var metadata = new BeatmapMetadata
|
||||
{
|
||||
Author = user,
|
||||
Author = new RealmUser
|
||||
{
|
||||
OnlineID = user.OnlineID,
|
||||
Username = user.Username,
|
||||
}
|
||||
};
|
||||
|
||||
var set = new BeatmapSetInfo
|
||||
|
@ -7,6 +7,7 @@ using Newtonsoft.Json;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Extensions;
|
||||
using osu.Game.Models;
|
||||
|
||||
#nullable enable
|
||||
|
||||
@ -123,8 +124,11 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
TitleUnicode = TitleUnicode,
|
||||
Artist = Artist,
|
||||
ArtistUnicode = ArtistUnicode,
|
||||
AuthorID = AuthorID,
|
||||
Author = Author,
|
||||
Author = new RealmUser
|
||||
{
|
||||
OnlineID = Author.OnlineID,
|
||||
Username = Author.Username
|
||||
},
|
||||
Source = Source,
|
||||
Tags = Tags,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user