mirror of
https://github.com/osukey/osukey.git
synced 2025-05-01 19:57:25 +09:00
Add some comments
This commit is contained in:
parent
712d586d41
commit
4b2d971b00
@ -9,7 +9,25 @@ namespace osu.Game.Rulesets.UI.Scrolling.Algorithms
|
|||||||
{
|
{
|
||||||
public interface IScrollingAlgorithm
|
public interface IScrollingAlgorithm
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Computes the states of <see cref="DrawableHitObject"/>s that are constant, such as lifetime and spatial length.
|
||||||
|
/// This is invoked once whenever <paramref name="timeRange"/> or <paramref name="length"/> changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="hitObjects">The <see cref="DrawableHitObject"/>s whose states should be computed.</param>
|
||||||
|
/// <param name="direction">The scrolling direction.</param>
|
||||||
|
/// <param name="timeRange">The duration required to scroll through one length of the screen before any control point adjustments.</param>
|
||||||
|
/// <param name="length">The length of the screen that is scrolled through.</param>
|
||||||
void ComputeInitialStates(IEnumerable<DrawableHitObject> hitObjects, ScrollingDirection direction, double timeRange, Vector2 length);
|
void ComputeInitialStates(IEnumerable<DrawableHitObject> hitObjects, ScrollingDirection direction, double timeRange, Vector2 length);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Computes the states of <see cref="DrawableHitObject"/>s that change depending on <paramref name="currentTime"/>, such as position.
|
||||||
|
/// This is invoked once per frame.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="hitObjects">The <see cref="DrawableHitObject"/>s whose states should be computed.</param>
|
||||||
|
/// <param name="direction">The scrolling direction.</param>
|
||||||
|
/// <param name="currentTime">The current time.</param>
|
||||||
|
/// <param name="timeRange">The duration required to scroll through one length of the screen before any control point adjustments.</param>
|
||||||
|
/// <param name="length">The length of the screen that is scrolled through.</param>
|
||||||
void ComputePositions(IEnumerable<DrawableHitObject> hitObjects, ScrollingDirection direction, double currentTime, double timeRange, Vector2 length);
|
void ComputePositions(IEnumerable<DrawableHitObject> hitObjects, ScrollingDirection direction, double currentTime, double timeRange, Vector2 length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,12 +15,18 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
{
|
{
|
||||||
public class ScrollingHitObjectContainer : HitObjectContainer
|
public class ScrollingHitObjectContainer : HitObjectContainer
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The duration required to scroll through one length of the <see cref="ScrollingHitObjectContainer"/> before any control point adjustments.
|
||||||
|
/// </summary>
|
||||||
public readonly BindableDouble TimeRange = new BindableDouble
|
public readonly BindableDouble TimeRange = new BindableDouble
|
||||||
{
|
{
|
||||||
MinValue = 0,
|
MinValue = 0,
|
||||||
MaxValue = double.MaxValue
|
MaxValue = double.MaxValue
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The control points that adjust the scrolling speed.
|
||||||
|
/// </summary>
|
||||||
protected readonly SortedList<MultiplierControlPoint> ControlPoints = new SortedList<MultiplierControlPoint>();
|
protected readonly SortedList<MultiplierControlPoint> ControlPoints = new SortedList<MultiplierControlPoint>();
|
||||||
|
|
||||||
private readonly ScrollingDirection direction;
|
private readonly ScrollingDirection direction;
|
||||||
@ -104,9 +110,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
{
|
{
|
||||||
base.UpdateAfterChildrenLife();
|
base.UpdateAfterChildrenLife();
|
||||||
|
|
||||||
// We need to calculate this as soon as possible after lifetimes so that hitobjects
|
// We need to calculate this as soon as possible after lifetimes so that hitobjects get the final say in their positions
|
||||||
// get the final say in their positions
|
|
||||||
|
|
||||||
scrollingAlgorithm.ComputePositions(AliveObjects, direction, Time.Current, TimeRange, DrawSize);
|
scrollingAlgorithm.ComputePositions(AliveObjects, direction, Time.Current, TimeRange, DrawSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user