mirror of
https://github.com/ppy/osu
synced 2025-02-01 10:51:53 +00:00
Assign a score's beatmap and cleanup to the Score class
This commit is contained in:
parent
718eefa362
commit
920710e7d0
@ -28,19 +28,8 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
|
|
||||||
public int Combo { get; set; }
|
public int Combo { get; set; }
|
||||||
|
|
||||||
private string[] modStrings;
|
|
||||||
[JsonProperty(@"mods")]
|
[JsonProperty(@"mods")]
|
||||||
protected string[] ModStrings
|
protected string[] ModStrings { get; set; }
|
||||||
{
|
|
||||||
get { return modStrings; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
modStrings = value;
|
|
||||||
|
|
||||||
if (ruleset != null)
|
|
||||||
handleModString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private RulesetInfo ruleset;
|
private RulesetInfo ruleset;
|
||||||
public RulesetInfo Ruleset
|
public RulesetInfo Ruleset
|
||||||
@ -50,8 +39,9 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
{
|
{
|
||||||
ruleset = value;
|
ruleset = value;
|
||||||
|
|
||||||
if (modStrings != null)
|
// Handle the mod strings if they are assigned
|
||||||
handleModString();
|
if (ModStrings != null)
|
||||||
|
Mods = Ruleset.CreateInstance().GetAllMods().Where(mod => ModStrings.Contains(mod.ShortenedName)).ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,10 +93,5 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Dictionary<string, dynamic> Statistics = new Dictionary<string, dynamic>();
|
public Dictionary<string, dynamic> Statistics = new Dictionary<string, dynamic>();
|
||||||
|
|
||||||
private void handleModString()
|
|
||||||
{
|
|
||||||
Mods = Ruleset.CreateInstance().GetAllMods().Where(mod => modStrings.Contains(mod.ShortenedName)).ToArray();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
i = 0;
|
i = 0;
|
||||||
foreach (var s in scores)
|
foreach (var s in scores)
|
||||||
{
|
{
|
||||||
|
s.Beatmap = beatmap;
|
||||||
s.Ruleset = beatmap?.Ruleset;
|
s.Ruleset = beatmap?.Ruleset;
|
||||||
|
|
||||||
var ls = new LeaderboardScore(s, 1 + i)
|
var ls = new LeaderboardScore(s, 1 + i)
|
||||||
|
Loading…
Reference in New Issue
Block a user