26
26
using osu . Game . Scoring ;
27
27
using osu . Game . Screens . Select . Leaderboards ;
28
28
using osu . Game . Screens . SelectV2 ;
29
- using osu . Game . Screens . SelectV2 . Leaderboards ;
30
29
using osu . Game . Tests . Resources ;
31
30
using osu . Game . Users ;
32
31
using osuTK . Input ;
@@ -38,7 +37,7 @@ public partial class TestSceneBeatmapRankingsWedge : SongSelectComponentsTestSce
38
37
[ Cached ]
39
38
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider ( OverlayColourScheme . Aquamarine ) ;
40
39
41
- private TestBeatmapRankingsWedge rankings = null ! ;
40
+ private TestBeatmapLeaderboardWedge leaderboard = null ! ;
42
41
private ScoreManager scoreManager = null ! ;
43
42
private RulesetStore rulesetStore = null ! ;
44
43
private BeatmapManager beatmapManager = null ! ;
@@ -82,7 +81,7 @@ public void SetUp() => Schedule(() =>
82
81
Children = new Drawable [ ]
83
82
{
84
83
dialogOverlay ,
85
- rankings = new TestBeatmapRankingsWedge
84
+ leaderboard = new TestBeatmapLeaderboardWedge
86
85
{
87
86
RelativeSizeAxes = Axes . Both ,
88
87
State = { Value = Visibility . Visible } ,
@@ -96,8 +95,8 @@ public void TestGlobalScoresDisplay()
96
95
{
97
96
setScope ( BeatmapLeaderboardScope . Global ) ;
98
97
99
- AddStep ( @"New Scores" , ( ) => rankings . SetScores ( generateSampleScores ( new BeatmapInfo ( ) ) ) ) ;
100
- AddStep ( @"New Scores with teams" , ( ) => rankings . SetScores ( generateSampleScores ( new BeatmapInfo ( ) ) . Select ( s =>
98
+ AddStep ( @"New Scores" , ( ) => leaderboard . SetScores ( generateSampleScores ( new BeatmapInfo ( ) ) ) ) ;
99
+ AddStep ( @"New Scores with teams" , ( ) => leaderboard . SetScores ( generateSampleScores ( new BeatmapInfo ( ) ) . Select ( s =>
101
100
{
102
101
s . User . Team = new APITeam ( ) ;
103
102
return s ;
@@ -119,21 +118,21 @@ public void TestPersonalBestWithNullPosition()
119
118
[ Test ]
120
119
public void TestPlaceholderStates ( )
121
120
{
122
- AddStep ( "ensure no scores displayed" , ( ) => rankings . SetScores ( Array . Empty < ScoreInfo > ( ) ) ) ;
123
-
124
- AddStep ( @"Network failure" , ( ) => rankings . SetState ( LeaderboardState . NetworkFailure ) ) ;
125
- AddStep ( @"No team" , ( ) => rankings . SetState ( LeaderboardState . NoTeam ) ) ;
126
- AddStep ( @"No supporter" , ( ) => rankings . SetState ( LeaderboardState . NotSupporter ) ) ;
127
- AddStep ( @"Not logged in" , ( ) => rankings . SetState ( LeaderboardState . NotLoggedIn ) ) ;
128
- AddStep ( @"Ruleset unavailable" , ( ) => rankings . SetState ( LeaderboardState . RulesetUnavailable ) ) ;
129
- AddStep ( @"Beatmap unavailable" , ( ) => rankings . SetState ( LeaderboardState . BeatmapUnavailable ) ) ;
130
- AddStep ( @"None selected" , ( ) => rankings . SetState ( LeaderboardState . NoneSelected ) ) ;
121
+ AddStep ( "ensure no scores displayed" , ( ) => leaderboard . SetScores ( Array . Empty < ScoreInfo > ( ) ) ) ;
122
+
123
+ AddStep ( @"Network failure" , ( ) => leaderboard . SetState ( LeaderboardState . NetworkFailure ) ) ;
124
+ AddStep ( @"No team" , ( ) => leaderboard . SetState ( LeaderboardState . NoTeam ) ) ;
125
+ AddStep ( @"No supporter" , ( ) => leaderboard . SetState ( LeaderboardState . NotSupporter ) ) ;
126
+ AddStep ( @"Not logged in" , ( ) => leaderboard . SetState ( LeaderboardState . NotLoggedIn ) ) ;
127
+ AddStep ( @"Ruleset unavailable" , ( ) => leaderboard . SetState ( LeaderboardState . RulesetUnavailable ) ) ;
128
+ AddStep ( @"Beatmap unavailable" , ( ) => leaderboard . SetState ( LeaderboardState . BeatmapUnavailable ) ) ;
129
+ AddStep ( @"None selected" , ( ) => leaderboard . SetState ( LeaderboardState . NoneSelected ) ) ;
131
130
}
132
131
133
132
[ Test ]
134
133
public void TestUseTheseModsDoesNotCopySystemMods ( )
135
134
{
136
- AddStep ( @"set scores" , ( ) => rankings . SetScores ( generateSampleScores ( new BeatmapInfo ( ) ) , new ScoreInfo
135
+ AddStep ( @"set scores" , ( ) => leaderboard . SetScores ( generateSampleScores ( new BeatmapInfo ( ) ) , new ScoreInfo
137
136
{
138
137
Position = 999 ,
139
138
Rank = ScoreRank . XH ,
@@ -149,19 +148,19 @@ public void TestUseTheseModsDoesNotCopySystemMods()
149
148
CountryCode = CountryCode . ES ,
150
149
}
151
150
} ) ) ;
152
- AddUntilStep ( "wait for scores" , ( ) => this . ChildrenOfType < LeaderboardScoreV2 > ( ) . Count ( ) , ( ) => Is . GreaterThan ( 0 ) ) ;
151
+ AddUntilStep ( "wait for scores" , ( ) => this . ChildrenOfType < BeatmapLeaderboardScore > ( ) . Count ( ) , ( ) => Is . GreaterThan ( 0 ) ) ;
153
152
AddStep ( "right click panel" , ( ) =>
154
153
{
155
- InputManager . MoveMouseTo ( this . ChildrenOfType < LeaderboardScoreV2 > ( ) . Last ( ) ) ;
154
+ InputManager . MoveMouseTo ( this . ChildrenOfType < BeatmapLeaderboardScore > ( ) . Last ( ) ) ;
156
155
InputManager . Click ( MouseButton . Right ) ;
157
156
} ) ;
158
157
AddStep ( "click use these mods" , ( ) =>
159
158
{
160
159
InputManager . MoveMouseTo ( this . ChildrenOfType < DrawableOsuMenuItem > ( ) . Last ( ) ) ;
161
160
InputManager . Click ( MouseButton . Left ) ;
162
161
} ) ;
163
- AddAssert ( "received HD" , ( ) => this . ChildrenOfType < LeaderboardScoreV2 > ( ) . Last ( ) . SelectedMods . Value . Any ( m => m is OsuModHidden ) ) ;
164
- AddAssert ( "did not receive SV2" , ( ) => ! this . ChildrenOfType < LeaderboardScoreV2 > ( ) . Last ( ) . SelectedMods . Value . Any ( m => m is ModScoreV2 ) ) ;
162
+ AddAssert ( "received HD" , ( ) => this . ChildrenOfType < BeatmapLeaderboardScore > ( ) . Last ( ) . SelectedMods . Value . Any ( m => m is OsuModHidden ) ) ;
163
+ AddAssert ( "did not receive SV2" , ( ) => ! this . ChildrenOfType < BeatmapLeaderboardScore > ( ) . Last ( ) . SelectedMods . Value . Any ( m => m is ModScoreV2 ) ) ;
165
164
}
166
165
167
166
[ Test ]
@@ -260,7 +259,7 @@ public void TestLocalScoresDisplayOnBeatmapEdit()
260
259
261
260
private void showPersonalBestWithNullPosition ( )
262
261
{
263
- rankings . SetScores ( generateSampleScores ( new BeatmapInfo ( ) ) , new ScoreInfo
262
+ leaderboard . SetScores ( generateSampleScores ( new BeatmapInfo ( ) ) , new ScoreInfo
264
263
{
265
264
Rank = ScoreRank . XH ,
266
265
Accuracy = 1 ,
@@ -279,7 +278,7 @@ private void showPersonalBestWithNullPosition()
279
278
280
279
private void showPersonalBest ( )
281
280
{
282
- rankings . SetScores ( generateSampleScores ( new BeatmapInfo ( ) ) , new ScoreInfo
281
+ leaderboard . SetScores ( generateSampleScores ( new BeatmapInfo ( ) ) , new ScoreInfo
283
282
{
284
283
Position = 999 ,
285
284
Rank = ScoreRank . XH ,
@@ -299,7 +298,7 @@ private void showPersonalBest()
299
298
300
299
private void setScope ( BeatmapLeaderboardScope scope )
301
300
{
302
- AddStep ( @"Set scope" , ( ) => ( ( Bindable < BeatmapLeaderboardScope > ) rankings . Scope ) . Value = scope ) ;
301
+ AddStep ( @"Set scope" , ( ) => ( ( Bindable < BeatmapLeaderboardScope > ) leaderboard . Scope ) . Value = scope ) ;
303
302
}
304
303
305
304
private void importMoreScores ( Func < BeatmapInfo > beatmapInfo )
@@ -317,7 +316,7 @@ private void clearScores()
317
316
}
318
317
319
318
private void checkDisplayedCount ( int expected ) =>
320
- AddUntilStep ( $ "{ expected } scores displayed", ( ) => rankings . ChildrenOfType < LeaderboardScoreV2 > ( ) . Count ( ) , ( ) => Is . EqualTo ( expected ) ) ;
319
+ AddUntilStep ( $ "{ expected } scores displayed", ( ) => leaderboard . ChildrenOfType < BeatmapLeaderboardScore > ( ) . Count ( ) , ( ) => Is . EqualTo ( expected ) ) ;
321
320
322
321
private void checkStoredCount ( int expected ) =>
323
322
AddUntilStep ( $ "Total scores stored is { expected } ", ( ) => Realm . Run ( r => r . All < ScoreInfo > ( ) . Count ( s => ! s . DeletePending ) ) , ( ) => Is . EqualTo ( expected ) ) ;
@@ -546,7 +545,7 @@ private static ScoreInfo[] generateSampleScores(BeatmapInfo beatmapInfo)
546
545
} ;
547
546
}
548
547
549
- private partial class TestBeatmapRankingsWedge : BeatmapRankingsWedge
548
+ private partial class TestBeatmapLeaderboardWedge : BeatmapLeaderboardWedge
550
549
{
551
550
public new void SetState ( LeaderboardState state ) => base . SetState ( state ) ;
552
551
public new void SetScores ( IEnumerable < ScoreInfo > scores , ScoreInfo ? userScore = null ) => base . SetScores ( scores , userScore ) ;
0 commit comments