mirror of https://github.com/ppy/osu
Add ShortName to rulesets
This commit is contained in:
parent
5330ca1fa9
commit
679134c030
|
@ -93,6 +93,8 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
|
|||
|
||||
public override string Description => "osu!catch";
|
||||
|
||||
public override string ShortName => "fruits";
|
||||
|
||||
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_fruits_o };
|
||||
|
||||
public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new CatchDifficultyCalculator(beatmap);
|
||||
|
|
|
@ -105,6 +105,8 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
|
|||
|
||||
public override string Description => "osu!mania";
|
||||
|
||||
public override string ShortName => "mania";
|
||||
|
||||
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_mania_o };
|
||||
|
||||
public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new ManiaDifficultyCalculator(beatmap);
|
||||
|
|
|
@ -124,6 +124,8 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
|
|||
|
||||
public override string Description => "osu!";
|
||||
|
||||
public override string ShortName => "osu";
|
||||
|
||||
public override SettingsSubsection CreateSettings() => new OsuSettings();
|
||||
|
||||
public override int LegacyID => 0;
|
||||
|
|
|
@ -95,6 +95,8 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
|
|||
|
||||
public override string Description => "osu!taiko";
|
||||
|
||||
public override string ShortName => "taiko";
|
||||
|
||||
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_taiko_o };
|
||||
|
||||
public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new TaikoDifficultyCalculator(beatmap);
|
||||
|
|
|
@ -63,6 +63,8 @@ public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatm
|
|||
|
||||
public override string Description => "dummy";
|
||||
|
||||
public override string ShortName => "dummy";
|
||||
|
||||
public DummyRuleset(RulesetInfo rulesetInfo)
|
||||
: base(rulesetInfo)
|
||||
{
|
||||
|
|
|
@ -23,13 +23,13 @@ public abstract class Ruleset
|
|||
public virtual IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { };
|
||||
|
||||
public IEnumerable<Mod> GetAllMods() => Enum.GetValues(typeof(ModType)).Cast<ModType>()
|
||||
// Get all mod types as an IEnumerable<ModType>
|
||||
.SelectMany(GetModsFor)
|
||||
// Confine all mods of each mod type into a single IEnumerable<Mod>
|
||||
.Where(mod => mod != null)
|
||||
// Filter out all null mods
|
||||
.SelectMany(mod => (mod as MultiMod)?.Mods ?? new[] { mod });
|
||||
// Resolve MultiMods as their .Mods property
|
||||
// Get all mod types as an IEnumerable<ModType>
|
||||
.SelectMany(GetModsFor)
|
||||
// Confine all mods of each mod type into a single IEnumerable<Mod>
|
||||
.Where(mod => mod != null)
|
||||
// Filter out all null mods
|
||||
.SelectMany(mod => (mod as MultiMod)?.Mods ?? new[] { mod });
|
||||
// Resolve MultiMods as their .Mods property
|
||||
|
||||
public abstract IEnumerable<Mod> GetModsFor(ModType type);
|
||||
|
||||
|
@ -66,6 +66,11 @@ protected Ruleset(RulesetInfo rulesetInfo)
|
|||
/// </summary>
|
||||
public virtual int LegacyID => -1;
|
||||
|
||||
/// <summary>
|
||||
/// A unique short name to reference this ruleset in online requests.
|
||||
/// </summary>
|
||||
public abstract string ShortName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of available variant ids.
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue