1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:43:05 +08:00

Add a method to get ruleset by name

This commit is contained in:
smoogipoo 2017-12-27 17:33:34 +09:00
parent b564215527
commit b87e6c8b2a

View File

@ -38,6 +38,13 @@ namespace osu.Game.Rulesets
/// <returns>A ruleset, if available, else null.</returns>
public RulesetInfo GetRuleset(int id) => AvailableRulesets.FirstOrDefault(r => r.ID == id);
/// <summary>
/// Retrieve a ruleset using a known short name.
/// </summary>
/// <param name="shortName">The ruleset's short name.</param>
/// <returns>A ruleset, if available, else null.</returns>
public RulesetInfo GetRuleset(string shortName) => AvailableRulesets.FirstOrDefault(r => r.ShortName == shortName);
/// <summary>
/// All available rulesets.
/// </summary>