1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 06:52:56 +08:00

Move common HitSampleInfo lookup to static method

This commit is contained in:
Dean Herbert 2020-09-25 17:30:31 +09:00
parent 98c6027352
commit b8e9f19b92
2 changed files with 6 additions and 4 deletions

View File

@ -17,6 +17,11 @@ namespace osu.Game.Audio
public const string HIT_NORMAL = @"hitnormal";
public const string HIT_CLAP = @"hitclap";
/// <summary>
/// All valid sample addition constants.
/// </summary>
public static IEnumerable<string> AllAdditions => new[] { HIT_WHISTLE, HIT_CLAP, HIT_FINISH };
/// <summary>
/// The bank to load the sample from.
/// </summary>

View File

@ -331,10 +331,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// </summary>
private void createStateBindables()
{
// hit samples
var sampleTypes = new[] { HitSampleInfo.HIT_WHISTLE, HitSampleInfo.HIT_CLAP, HitSampleInfo.HIT_FINISH };
foreach (var sampleName in sampleTypes)
foreach (var sampleName in HitSampleInfo.AllAdditions)
{
var bindable = new Bindable<TernaryState>
{