mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 16:43:00 +08:00
Add a method to get ruleset by name
This commit is contained in:
parent
b564215527
commit
b87e6c8b2a
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user