Rewrite/add comments.

This commit is contained in:
smoogipooo
2017-08-07 17:25:40 +09:00
parent 933740664c
commit 9c0a0b1e2c
5 changed files with 81 additions and 80 deletions

View File

@ -11,19 +11,14 @@ using OpenTK;
namespace osu.Game.Rulesets.Timing
{
/// <summary>
/// A container for hit objects which applies applies the speed adjustments defined by the properties of a <see cref="Timing.MultiplierControlPoint"/>
/// to affect the scroll speed of the contained <see cref="ScrollingContainer"/>.
///
/// <para>
/// This container must always be relatively-sized to its parent to provide the speed adjustments. This container will provide the speed adjustments
/// by modifying its size while maintaining a constant <see cref="Container{T}.RelativeChildSize"/> for its children
/// </para>
/// A container that provides the speed adjustments defined by <see cref="MultiplierControlPoint"/>s to affect the scroll speed
/// of container <see cref="DrawableHitObject"/>s.
/// </summary>
public class SpeedAdjustmentContainer : Container<DrawableHitObject>
{
private readonly Bindable<double> visibleTimeRange = new Bindable<double> { Default = 1000 };
/// <summary>
/// Gets or sets the range of time that is visible by the length of this container.
/// Gets or sets the range of time that is visible by the length of the scrolling axes.
/// </summary>
public Bindable<double> VisibleTimeRange
{
@ -35,10 +30,13 @@ namespace osu.Game.Rulesets.Timing
private Container<DrawableHitObject> content;
/// <summary>
/// Axes which the content of this container will scroll through.
/// The axes which the content of this container will scroll through.
/// </summary>
public Axes ScrollingAxes { get; internal set; }
/// <summary>
/// The <see cref="MultiplierControlPoint"/> that defines the speed adjustments.
/// </summary>
public readonly MultiplierControlPoint ControlPoint;
private ScrollingContainer scrollingContainer;
@ -46,11 +44,10 @@ namespace osu.Game.Rulesets.Timing
/// <summary>
/// Creates a new <see cref="SpeedAdjustmentContainer"/>.
/// </summary>
/// <param name="controlPoint">The <see cref="MultiplierControlPoint"/> which provides the speed adjustments for this container.</param>
/// <param name="controlPoint">The <see cref="MultiplierControlPoint"/> that defines the speed adjustments.</param>
public SpeedAdjustmentContainer(MultiplierControlPoint controlPoint)
{
ControlPoint = controlPoint;
RelativeSizeAxes = Axes.Both;
}
@ -93,17 +90,17 @@ namespace osu.Game.Rulesets.Timing
}
/// <summary>
/// Whether this speed adjustment can contain a hit object. This is true if the hit object occurs after this speed adjustment with respect to time.
/// Whether a <see cref="DrawableHitObject"/> falls within this <see cref="SpeedAdjustmentContainer"/>s affecting timespan.
/// </summary>
public bool CanContain(DrawableHitObject hitObject) => CanContain(hitObject.HitObject.StartTime);
/// <summary>
/// Whether this speed adjustment can contain an object placed at a time value. This is true if the time occurs after this speed adjustment.
/// Whether a point in time falls within this <see cref="SpeedAdjustmentContainer"/>s affecting timespan.
/// </summary>
public bool CanContain(double startTime) => ControlPoint.StartTime <= startTime;
/// <summary>
/// Creates the container which contains a collection of hit objects and scrolls through this SpeedAdjustmentContainer.
/// Creates the <see cref="ScrollingContainer"/> which contains the scrolling <see cref="DrawableHitObject"/>s of this container.
/// </summary>
/// <returns>The <see cref="ScrollingContainer"/>.</returns>
protected virtual ScrollingContainer CreateScrollingContainer() => new LinearScrollingContainer(ScrollingAxes, ControlPoint);