// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; namespace osu.Game.Audio { /// /// Describes a gameplay hit sample. /// [Serializable] public class HitSampleInfo : ISampleInfo { public const string HIT_WHISTLE = @"hitwhistle"; public const string HIT_FINISH = @"hitfinish"; public const string HIT_NORMAL = @"hitnormal"; public const string HIT_CLAP = @"hitclap"; /// /// All valid sample addition constants. /// public static IEnumerable AllAdditions => new[] { HIT_WHISTLE, HIT_CLAP, HIT_FINISH }; /// /// The bank to load the sample from. /// public string Bank; /// /// The name of the sample to load. /// public string Name; /// /// An optional suffix to provide priority lookup. Falls back to non-suffixed . /// public string Suffix; /// /// The sample volume. /// public int Volume { get; set; } /// /// Retrieve all possible filenames that can be used as a source, returned in order of preference (highest first). /// public virtual IEnumerable LookupNames { get { if (!string.IsNullOrEmpty(Suffix)) yield return $"Gameplay/{Bank}-{Name}{Suffix}"; yield return $"Gameplay/{Bank}-{Name}"; } } public HitSampleInfo Clone() => (HitSampleInfo)MemberwiseClone(); } }