mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 23:22:55 +08:00
Made modString private and moved the beatmap assignment inside GetScoresRequest
This commit is contained in:
parent
2c287e1348
commit
105048500a
@ -16,6 +16,17 @@ namespace osu.Game.Online.API.Requests
|
||||
public GetScoresRequest(BeatmapInfo beatmap)
|
||||
{
|
||||
this.beatmap = beatmap;
|
||||
|
||||
Success += onSuccess;
|
||||
}
|
||||
|
||||
private void onSuccess(GetScoresResponse r)
|
||||
{
|
||||
foreach (Score score in r.Scores)
|
||||
{
|
||||
score.Beatmap = beatmap;
|
||||
score.Ruleset = beatmap.Ruleset;
|
||||
}
|
||||
}
|
||||
|
||||
protected override WebRequest CreateWebRequest()
|
||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Scoring
|
||||
public int Combo { get; set; }
|
||||
|
||||
[JsonProperty(@"mods")]
|
||||
protected string[] ModStrings { get; set; }
|
||||
private string[] modStrings { get; set; }
|
||||
|
||||
private RulesetInfo ruleset;
|
||||
public RulesetInfo Ruleset
|
||||
@ -40,8 +40,8 @@ namespace osu.Game.Rulesets.Scoring
|
||||
ruleset = value;
|
||||
|
||||
// Handle the mod strings if they are assigned
|
||||
if (ModStrings != null)
|
||||
Mods = Ruleset.CreateInstance().GetAllMods().Where(mod => ModStrings.Contains(mod.ShortenedName)).ToArray();
|
||||
if (modStrings != null)
|
||||
Mods = ruleset.CreateInstance().GetAllMods().Where(mod => modStrings.Contains(mod.ShortenedName)).ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,9 +55,6 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
i = 0;
|
||||
foreach (var s in scores)
|
||||
{
|
||||
s.Beatmap = beatmap;
|
||||
s.Ruleset = beatmap?.Ruleset;
|
||||
|
||||
var ls = new LeaderboardScore(s, 1 + i)
|
||||
{
|
||||
AlwaysPresent = true,
|
||||
|
Loading…
Reference in New Issue
Block a user