mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:43:05 +08:00
Expose binary search methods publicly
Co-authored-by: Dan Balasescu <smoogipoo@smgi.me>
This commit is contained in:
parent
a7d4a74ed6
commit
a754dc6d3b
@ -196,7 +196,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
/// <param name="time">The time to find the control point at.</param>
|
/// <param name="time">The time to find the control point at.</param>
|
||||||
/// <param name="fallback">The control point to use when <paramref name="time"/> is before any control points.</param>
|
/// <param name="fallback">The control point to use when <paramref name="time"/> is before any control points.</param>
|
||||||
/// <returns>The active control point at <paramref name="time"/>, or a fallback <see cref="ControlPoint"/> if none found.</returns>
|
/// <returns>The active control point at <paramref name="time"/>, or a fallback <see cref="ControlPoint"/> if none found.</returns>
|
||||||
internal static T BinarySearchWithFallback<T>(IReadOnlyList<T> list, double time, T fallback)
|
public static T BinarySearchWithFallback<T>(IReadOnlyList<T> list, double time, T fallback)
|
||||||
where T : class, IControlPoint
|
where T : class, IControlPoint
|
||||||
{
|
{
|
||||||
return BinarySearch(list, time) ?? fallback;
|
return BinarySearch(list, time) ?? fallback;
|
||||||
@ -208,7 +208,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
/// <param name="list">The list to search.</param>
|
/// <param name="list">The list to search.</param>
|
||||||
/// <param name="time">The time to find the control point at.</param>
|
/// <param name="time">The time to find the control point at.</param>
|
||||||
/// <returns>The active control point at <paramref name="time"/>.</returns>
|
/// <returns>The active control point at <paramref name="time"/>.</returns>
|
||||||
internal static T BinarySearch<T>(IReadOnlyList<T> list, double time)
|
public static T BinarySearch<T>(IReadOnlyList<T> list, double time)
|
||||||
where T : class, IControlPoint
|
where T : class, IControlPoint
|
||||||
{
|
{
|
||||||
if (list == null)
|
if (list == null)
|
||||||
|
Loading…
Reference in New Issue
Block a user