Decouple APILegacyScoreInfo from ScoreInfo

This commit is contained in:
Dean Herbert
2019-12-03 15:28:10 +09:00
parent 8a6b2e681a
commit f0d49d0cdf
14 changed files with 254 additions and 227 deletions

View File

@ -41,6 +41,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
[Resolved]
private IAPIProvider api { get; set; }
[Resolved]
private RulesetStore rulesets { get; set; }
private GetScoresRequest getScoresRequest;
protected APILegacyScores Scores
@ -56,16 +59,19 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
return;
}
scoreTable.Scores = value.Scores;
var scoreInfos = value.Scores.Select(s => s.CreateScoreInfo(rulesets)).ToList();
scoreTable.Scores = scoreInfos;
scoreTable.Show();
var topScore = value.Scores.First();
var topScore = scoreInfos.First();
var userScore = value.UserScore;
var userScoreInfo = userScore?.Score.CreateScoreInfo(rulesets);
topScoresContainer.Add(new DrawableTopScore(topScore));
if (userScore != null && userScore.Score.OnlineScoreID != topScore.OnlineScoreID)
topScoresContainer.Add(new DrawableTopScore(userScore.Score, userScore.Position));
if (userScoreInfo != null && userScoreInfo.OnlineScoreID != topScore.OnlineScoreID)
topScoresContainer.Add(new DrawableTopScore(userScoreInfo, userScore.Position));
});
}