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

split shortcut into two methods

This commit is contained in:
mcendu 2020-03-31 17:48:37 +08:00
parent 71fc240aee
commit 977e1a3bfe
No known key found for this signature in database
GPG Key ID: FBCD5D45163D6364

View File

@ -40,14 +40,23 @@ namespace osu.Game.Rulesets.Mania.Skinning
} }
} }
/// <summary>
/// Retrieve a per-column-count skin configuration.
/// </summary>
/// <param name="skin">The skin from which configuration is retrieved.</param>
/// <param name="lookup">The value to retrieve.</param>
/// <param name="index">If not null, denotes the index of the column to which the entry applies.</param>
protected IBindable<T> GetManiaSkinConfig<T>(ISkin skin, LegacyManiaSkinConfigurationLookups lookup, int? index = null)
=> skin.GetConfig<LegacyManiaSkinConfigurationLookup, T>(
new LegacyManiaSkinConfigurationLookup(Stage?.Columns.Count ?? 4, lookup, index));
/// <summary> /// <summary>
/// Retrieve a per-column skin configuration. /// Retrieve a per-column skin configuration.
/// </summary> /// </summary>
/// <param name="skin">The skin from which configuration is retrieved.</param> /// <param name="skin">The skin from which configuration is retrieved.</param>
/// <param name="lookup">The value to retrieve.</param> /// <param name="lookup">The value to retrieve.</param>
/// <param name="index">The index of the column to which the entry applies.</param> /// <param name="index">The index of the column to which the entry applies. Defaults to the column index.</param>
protected IBindable<T> GetManiaSkinConfig<T>(ISkin skin, LegacyManiaSkinConfigurationLookups lookup, int? index = null) protected IBindable<T> GetPerColumnSkinConfig<T>(ISkin skin, LegacyManiaSkinConfigurationLookups lookup, int? index = null)
=> skin.GetConfig<LegacyManiaSkinConfigurationLookup, T>( => GetManiaSkinConfig<T>(skin, lookup, index ?? Column.Index);
new LegacyManiaSkinConfigurationLookup(Stage?.Columns.Count ?? 4, lookup, index ?? Column.Index));
} }
} }