mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 02:32:55 +08:00
Cleanup mods string
This commit is contained in:
parent
b673eb79b1
commit
5530736541
@ -43,23 +43,16 @@ namespace osu.Game.Scoring
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (modsString == null)
|
if (ModsString == null)
|
||||||
return Array.Empty<Mod>();
|
return Array.Empty<Mod>();
|
||||||
|
|
||||||
var deserialized = JsonConvert.DeserializeObject<string[]>(modsString);
|
var deserialized = JsonConvert.DeserializeObject<string[]>(ModsString);
|
||||||
return Ruleset.CreateInstance().GetAllMods().Where(mod => deserialized.Any(d => d == mod.ShortenedName)).ToArray();
|
return Ruleset.CreateInstance().GetAllMods().Where(mod => deserialized.Any(d => d == mod.ShortenedName)).ToArray();
|
||||||
}
|
}
|
||||||
set => modsString = JsonConvert.SerializeObject(value.Select(m => m.ShortenedName).ToArray());
|
set => ModsString = JsonConvert.SerializeObject(value.Select(m => m.ShortenedName).ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
[NotMapped, JsonIgnore]
|
public string ModsString { get; set; }
|
||||||
private string modsString;
|
|
||||||
|
|
||||||
public string ModsString
|
|
||||||
{
|
|
||||||
get => modsString;
|
|
||||||
set => modsString = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[NotMapped, JsonIgnore]
|
[NotMapped, JsonIgnore]
|
||||||
public User User;
|
public User User;
|
||||||
|
Loading…
Reference in New Issue
Block a user