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_NORMAL = @"hitnormal";
public const string HIT_CLAP = @"hitclap"; 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> /// <summary>
/// The bank to load the sample from. /// The bank to load the sample from.
/// </summary> /// </summary>

View File

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