1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 15:52:54 +08:00

CI fix, fixed nullref and removed abstraction of GetAutoplayMod

This commit is contained in:
MrTheMake 2017-08-13 20:12:01 +02:00
parent d9c26f98c7
commit 81289db33b
6 changed files with 3 additions and 13 deletions

View File

@ -84,8 +84,6 @@ namespace osu.Game.Rulesets.Catch
} }
} }
public override Mod GetAutoplayMod() => new ModAutoplay();
public override string Description => "osu!catch"; public override string Description => "osu!catch";
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_fruits_o }; public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_fruits_o };

View File

@ -105,8 +105,6 @@ namespace osu.Game.Rulesets.Mania
} }
} }
public override Mod GetAutoplayMod() => new ModAutoplay();
public override string Description => "osu!mania"; public override string Description => "osu!mania";
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_mania_o }; public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_mania_o };

View File

@ -105,8 +105,6 @@ namespace osu.Game.Rulesets.Osu
} }
} }
public override Mod GetAutoplayMod() => new OsuModAutoplay();
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_osu_o }; public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_osu_o };
public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new OsuDifficultyCalculator(beatmap); public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new OsuDifficultyCalculator(beatmap);

View File

@ -84,8 +84,6 @@ namespace osu.Game.Rulesets.Taiko
} }
} }
public override Mod GetAutoplayMod() => new TaikoModAutoplay();
public override string Description => "osu!taiko"; public override string Description => "osu!taiko";
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_taiko_o }; public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_taiko_o };

View File

@ -60,8 +60,6 @@ namespace osu.Game.Beatmaps
{ {
public override IEnumerable<Mod> GetModsFor(ModType type) => new Mod[] { }; public override IEnumerable<Mod> GetModsFor(ModType type) => new Mod[] { };
public override Mod GetAutoplayMod() => new ModAutoplay();
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset)
{ {
throw new NotImplementedException(); throw new NotImplementedException();

View File

@ -26,14 +26,14 @@ namespace osu.Game.Rulesets
List<Mod> modList = new List<Mod>(); List<Mod> modList = new List<Mod>();
foreach (ModType type in Enum.GetValues(typeof(ModType))) foreach (ModType type in Enum.GetValues(typeof(ModType)))
modList.AddRange(GetModsFor(type).SelectMany(mod => modList.AddRange(GetModsFor(type).Where(mod => mod != null).SelectMany(mod =>
{ {
var multiMod = mod as MultiMod; var multiMod = mod as MultiMod;
if (multiMod != null) if (multiMod != null)
return multiMod.Mods; return multiMod.Mods;
return new Mod[] { mod }; return new[] { mod };
})); }));
return modList.ToArray(); return modList.ToArray();
@ -46,7 +46,7 @@ namespace osu.Game.Rulesets
return GetAllMods().First(mod => mod.ShortenedName == shortenedName); return GetAllMods().First(mod => mod.ShortenedName == shortenedName);
} }
public abstract Mod GetAutoplayMod(); public Mod GetAutoplayMod() => GetAllMods().First(mod => mod is ModAutoplay);
protected Ruleset(RulesetInfo rulesetInfo) protected Ruleset(RulesetInfo rulesetInfo)
{ {