1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Add xmldoc to SnapFinder

This commit is contained in:
Justus Franklin Tumacder 2021-04-25 08:53:45 +08:00
parent 8b9d2a6cff
commit 1f48378ce7

View File

@ -8,10 +8,17 @@ using osu.Game.Beatmaps.ControlPoints;
namespace osu.Game.Rulesets.Objects
{
/// <summary>
/// Used to find the lowest beat divisor that a <see cref="HitObject"/> aligns to in an <see cref="IBeatmap"/>
/// </summary>
public class SnapFinder
{
private readonly IBeatmap beatmap;
/// <summary>
/// Creates a new SnapFinder instance.
/// </summary>
/// <param name="beatmap">The beatmap to align to when evaulating.</param>
public SnapFinder(IBeatmap beatmap)
{
this.beatmap = beatmap;
@ -19,6 +26,10 @@ namespace osu.Game.Rulesets.Objects
private readonly static int[] snaps = { 1, 2, 3, 4, 6, 8, 12, 16 };
/// <summary>
/// Finds the lowest beat divisor that the given HitObject aligns to.
/// </summary>
/// <param name="hitObject">The <see cref="HitObject"/> to evaluate.</param>
public int FindSnap(HitObject hitObject)
{
TimingControlPoint currentTimingPoint = beatmap.ControlPointInfo.TimingPointAt(hitObject.StartTime);