1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 18:23:04 +08:00

Cleanup mods string

This commit is contained in:
smoogipoo 2018-11-30 14:24:10 +09:00
parent b673eb79b1
commit 5530736541

View File

@ -43,23 +43,16 @@ namespace osu.Game.Scoring
{
get
{
if (modsString == null)
if (ModsString == null)
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();
}
set => modsString = JsonConvert.SerializeObject(value.Select(m => m.ShortenedName).ToArray());
set => ModsString = JsonConvert.SerializeObject(value.Select(m => m.ShortenedName).ToArray());
}
[NotMapped, JsonIgnore]
private string modsString;
public string ModsString
{
get => modsString;
set => modsString = value;
}
public string ModsString { get; set; }
[NotMapped, JsonIgnore]
public User User;