// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. namespace osu.Game.Rulesets.UI.Scrolling.Algorithms { public interface IScrollAlgorithm { /// /// Given a point in time, computes the time at which it enters the time range. /// /// /// E.g. For a constant time range of 5000ms, the time at which t=7000ms enters the time range is 2000ms. /// /// The point in time. /// The amount of visible time. /// The time at which enters . double GetDisplayStartTime(double time, double timeRange); /// /// Computes the spatial length within a start and end time. /// /// The start time. /// The end time. /// The amount of visible time. /// The absolute spatial length through . /// The absolute spatial length. float GetLength(double startTime, double endTime, double timeRange, float scrollLength); /// /// Given the current time, computes the spatial position of a point in time. /// /// The time to compute the spatial position of. /// The current time. /// The amount of visible time. /// The absolute spatial length through . /// The absolute spatial position. float PositionAt(double time, double currentTime, double timeRange, float scrollLength); /// /// Computes the time which brings a point to a provided spatial position given the current time. /// /// The absolute spatial position. /// The current time. /// The amount of visible time. /// The absolute spatial length through . /// The time at which == . double TimeAt(float position, double currentTime, double timeRange, float scrollLength); /// /// Resets this to a default state. /// void Reset(); } }