1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Use ShouldSerializeFlashlightRating() to serialise database attribute

This commit is contained in:
Dan Balasescu 2021-11-17 20:23:08 +09:00
parent 2ae46f901e
commit 43cbb23b15

View File

@ -50,7 +50,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty
yield return (9, MaxCombo);
yield return (11, StarRating);
if (Mods.Any(m => m is ModFlashlight))
if (ShouldSerializeFlashlightRating())
yield return (17, FlashlightRating);
yield return (19, SliderFactor);
@ -72,6 +72,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty
// Used implicitly by Newtonsoft.Json to not serialize flashlight property in some cases.
[UsedImplicitly]
public bool ShouldSerializeFlashlightRating() => Mods.OfType<ModFlashlight>().Any();
public bool ShouldSerializeFlashlightRating() => Mods.Any(m => m is ModFlashlight);
}
}