Convert SoloResultsScreen to NRT

This commit is contained in:
Bartłomiej Dach 2022-12-28 07:49:09 +01:00
parent a0a26b1e8c
commit 04f9a354c3
No known key found for this signature in database

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -26,15 +24,15 @@ namespace osu.Game.Screens.Ranking
/// </summary> /// </summary>
public bool ShowUserStatistics { get; init; } public bool ShowUserStatistics { get; init; }
private GetScoresRequest getScoreRequest; private GetScoresRequest? getScoreRequest;
[Resolved] [Resolved]
private RulesetStore rulesets { get; set; } private RulesetStore rulesets { get; set; } = null!;
[Resolved] [Resolved]
private SoloStatisticsWatcher soloStatisticsWatcher { get; set; } private SoloStatisticsWatcher soloStatisticsWatcher { get; set; } = null!;
private readonly Bindable<SoloStatisticsUpdate> statisticsUpdate = new Bindable<SoloStatisticsUpdate>(); private readonly Bindable<SoloStatisticsUpdate?> statisticsUpdate = new Bindable<SoloStatisticsUpdate?>();
public SoloResultsScreen(ScoreInfo score, bool allowRetry) public SoloResultsScreen(ScoreInfo score, bool allowRetry)
: base(score, allowRetry) : base(score, allowRetry)
@ -62,7 +60,7 @@ namespace osu.Game.Screens.Ranking
return base.CreateStatisticsPanel(); return base.CreateStatisticsPanel();
} }
protected override APIRequest FetchScores(Action<IEnumerable<ScoreInfo>> scoresCallback) protected override APIRequest? FetchScores(Action<IEnumerable<ScoreInfo>>? scoresCallback)
{ {
if (Score.BeatmapInfo.OnlineID <= 0 || Score.BeatmapInfo.Status <= BeatmapOnlineStatus.Pending) if (Score.BeatmapInfo.OnlineID <= 0 || Score.BeatmapInfo.Status <= BeatmapOnlineStatus.Pending)
return null; return null;