1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 18:27:26 +08:00

Formatted the GetAllMods() function

This commit is contained in:
MrTheMake 2017-08-14 18:24:54 +02:00
parent 5ed717ef86
commit e908a3675e

View File

@ -21,21 +21,7 @@ namespace osu.Game.Rulesets
public virtual IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { };
public IEnumerable<Mod> GetAllMods()
{
return Enum.GetValues(typeof(ModType)).Cast<ModType>().SelectMany(type =>
{
return GetModsFor(type).Where(mod => mod != null).SelectMany(mod =>
{
var multiMod = mod as MultiMod;
if (multiMod != null)
return multiMod.Mods;
return new[] { mod };
});
});
}
public IEnumerable<Mod> GetAllMods() => Enum.GetValues(typeof(ModType)).Cast<ModType>().SelectMany(type => GetModsFor(type).Where(mod => mod != null).SelectMany(mod => (mod as MultiMod)?.Mods ?? new[] { mod }));
public abstract IEnumerable<Mod> GetModsFor(ModType type);