Simplify and tidy sample retrieval

Less static weirdness
This commit is contained in:
Dean Herbert
2017-12-23 16:46:02 +09:00
parent 5026c7a95e
commit 9ca03c0209
4 changed files with 25 additions and 21 deletions

View File

@ -1,6 +1,8 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Audio;
namespace osu.Game.Beatmaps.ControlPoints
{
public class SampleControlPoint : ControlPoint
@ -16,5 +18,17 @@ namespace osu.Game.Beatmaps.ControlPoints
/// The default sample volume at this control point.
/// </summary>
public int SampleVolume;
/// <summary>
/// Create a SampleInfo based on the sample settings in this control point.
/// </summary>
/// <param name="sampleName">The name of the same.</param>
/// <returns>A populated <see cref="SampleInfo"/>.</returns>
public SampleInfo GetSampleInfo(string sampleName = SampleInfo.HIT_NORMAL) => new SampleInfo
{
Bank = SampleBank,
Name = sampleName,
Volume = SampleVolume,
};
}
}