mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Merge pull request #11199 from smoogipoo/refactor-player-score-creation
Asyncify player score creation and submission
This commit is contained in:
@ -10,6 +10,8 @@ using osu.Framework.Timing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Ranking;
|
||||
using osu.Game.Storyboards;
|
||||
using osuTK;
|
||||
|
||||
@ -50,7 +52,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
cancel();
|
||||
complete();
|
||||
|
||||
AddUntilStep("attempted to push ranking", () => ((FakeRankingPushPlayer)Player).GotoRankingInvoked);
|
||||
AddUntilStep("attempted to push ranking", () => ((FakeRankingPushPlayer)Player).ResultsCreated);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -84,7 +86,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
// wait to ensure there was no attempt of pushing the results screen.
|
||||
AddWaitStep("wait", resultsDisplayWaitCount);
|
||||
AddAssert("no attempt to push ranking", () => !((FakeRankingPushPlayer)Player).GotoRankingInvoked);
|
||||
AddAssert("no attempt to push ranking", () => !((FakeRankingPushPlayer)Player).ResultsCreated);
|
||||
}
|
||||
|
||||
protected override WorkingBeatmap CreateWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard = null)
|
||||
@ -110,16 +112,18 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
|
||||
public class FakeRankingPushPlayer : TestPlayer
|
||||
{
|
||||
public bool GotoRankingInvoked;
|
||||
public bool ResultsCreated { get; private set; }
|
||||
|
||||
public FakeRankingPushPlayer()
|
||||
: base(true, true)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void GotoRanking()
|
||||
protected override ResultsScreen CreateResults(ScoreInfo score)
|
||||
{
|
||||
GotoRankingInvoked = true;
|
||||
var results = base.CreateResults(score);
|
||||
ResultsCreated = true;
|
||||
return results;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user