mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 21:02:54 +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>
|
/// <returns>A ruleset, if available, else null.</returns>
|
||||||
public RulesetInfo GetRuleset(int id) => AvailableRulesets.FirstOrDefault(r => r.ID == id);
|
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>
|
/// <summary>
|
||||||
/// All available rulesets.
|
/// All available rulesets.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user