2019-10-25 15:50:21 +08:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osuTK ;
namespace osu.Game.Rulesets.Edit
{
2022-05-05 14:58:21 +08:00
/// <summary>
2022-05-05 15:04:34 +08:00
/// A snap provider which given a proposed position for a hit object, potentially offers a more correct position and time value inferred from the context of the beatmap.
/// Provided values are inferred in an isolated context, without consideration of other nearby hit objects.
2022-05-05 14:58:21 +08:00
/// </summary>
2020-05-20 16:48:43 +08:00
public interface IPositionSnapProvider
2019-10-25 15:50:21 +08:00
{
2020-05-20 16:48:43 +08:00
/// <summary>
2020-11-24 16:14:39 +08:00
/// Given a position, find a valid time and position snap.
2020-05-20 16:48:43 +08:00
/// </summary>
2020-11-24 16:14:39 +08:00
/// <remarks>
2022-05-05 14:58:21 +08:00
/// This call should be equivalent to running <see cref="FindSnappedPosition"/> with any additional logic that can be performed without the time immutability restriction.
2020-11-24 16:14:39 +08:00
/// </remarks>
2020-05-20 17:19:21 +08:00
/// <param name="screenSpacePosition">The screen-space position to be snapped.</param>
2020-05-20 16:48:43 +08:00
/// <returns>The time and position post-snapping.</returns>
2022-05-05 14:58:21 +08:00
SnapResult FindSnappedPositionAndTime ( Vector2 screenSpacePosition ) ;
2019-10-25 15:50:21 +08:00
2020-11-24 16:14:39 +08:00
/// <summary>
2022-05-05 16:07:05 +08:00
/// Given a position, find a valid position snap, without changing the time value.
2020-11-24 16:14:39 +08:00
/// </summary>
/// <param name="screenSpacePosition">The screen-space position to be snapped.</param>
/// <returns>The position post-snapping. Time will always be null.</returns>
2022-05-05 14:58:21 +08:00
SnapResult FindSnappedPosition ( Vector2 screenSpacePosition ) ;
2019-10-25 15:50:21 +08:00
}
}