Cleanup + commenting

This commit is contained in:
smoogipooo 2017-09-20 15:55:23 +09:00
parent fd278256ad
commit 01d84893a0

View File

@ -49,6 +49,9 @@ namespace osu.Game.Tests.Visual
osuGame.Beatmap.Value = beatmaps.GetWorkingBeatmap(setInfo.Beatmaps[0]); osuGame.Beatmap.Value = beatmaps.GetWorkingBeatmap(setInfo.Beatmaps[0]);
} }
/// <summary>
/// The timeline that sits at the bottom of the editor.
/// </summary>
private class MiniTimeline : CompositeDrawable private class MiniTimeline : CompositeDrawable
{ {
private const float corner_radius = 5; private const float corner_radius = 5;
@ -180,21 +183,23 @@ namespace osu.Game.Tests.Visual
} }
protected override bool OnDragStart(InputState state) => true; protected override bool OnDragStart(InputState state) => true;
protected override bool OnDragEnd(InputState state) => true;
protected override bool OnDrag(InputState state) protected override bool OnDrag(InputState state)
{ {
seekToPosition(state.Mouse.NativeState.Position); seekToPosition(state.Mouse.NativeState.Position);
return true; return true;
} }
protected override bool OnDragEnd(InputState state) => true;
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{ {
seekToPosition(state.Mouse.NativeState.Position); seekToPosition(state.Mouse.NativeState.Position);
return true; return true;
} }
/// <summary>
/// Seeks the <see cref="MiniTimeline"/> to the time closest to a position on the screen relative to the <see cref="MiniTimeline"/>.
/// </summary>
/// <param name="screenPosition">The position in screen coordinates.</param>
private void seekToPosition(Vector2 screenPosition) private void seekToPosition(Vector2 screenPosition)
{ {
float markerPos = MathHelper.Clamp(markerContainer.ToLocalSpace(screenPosition).X, 0, markerContainer.DrawWidth); float markerPos = MathHelper.Clamp(markerContainer.ToLocalSpace(screenPosition).X, 0, markerContainer.DrawWidth);
@ -206,10 +211,12 @@ namespace osu.Game.Tests.Visual
protected override void Update() protected override void Update()
{ {
base.Update(); base.Update();
marker.X = (float)beatmap.Value.Track.CurrentTime; marker.X = (float)beatmap.Value.Track.CurrentTime;
} }
/// <summary>
/// The part of the timeline that displays the control points.
/// </summary>
private class ControlPointTimeline : Timeline private class ControlPointTimeline : Timeline
{ {
protected override void LoadBeatmap(WorkingBeatmap beatmap) protected override void LoadBeatmap(WorkingBeatmap beatmap)
@ -265,6 +272,9 @@ namespace osu.Game.Tests.Visual
} }
} }
/// <summary>
/// The part of the timeline that displays bookmarks.
/// </summary>
private class BookmarkTimeline : Timeline private class BookmarkTimeline : Timeline
{ {
protected override void LoadBeatmap(WorkingBeatmap beatmap) protected override void LoadBeatmap(WorkingBeatmap beatmap)
@ -285,6 +295,9 @@ namespace osu.Game.Tests.Visual
} }
} }
/// <summary>
/// The part of the timeline that displays breaks in the song.
/// </summary>
private class BreakTimeline : Timeline private class BreakTimeline : Timeline
{ {
protected override void LoadBeatmap(WorkingBeatmap beatmap) protected override void LoadBeatmap(WorkingBeatmap beatmap)
@ -305,6 +318,9 @@ namespace osu.Game.Tests.Visual
} }
} }
/// <summary>
/// Represents a part of the editor timeline.
/// </summary>
private abstract class Timeline : CompositeDrawable private abstract class Timeline : CompositeDrawable
{ {
private readonly Container timeline; private readonly Container timeline;
@ -334,6 +350,9 @@ namespace osu.Game.Tests.Visual
protected abstract void LoadBeatmap(WorkingBeatmap beatmap); protected abstract void LoadBeatmap(WorkingBeatmap beatmap);
} }
/// <summary>
/// Represents a singular point on a <see cref="Timeline"/>.
/// </summary>
private class PointVisualisation : Box private class PointVisualisation : Box
{ {
public readonly double StartTime; public readonly double StartTime;
@ -353,6 +372,9 @@ namespace osu.Game.Tests.Visual
} }
} }
/// <summary>
/// Represents a spanning point on a <see cref="Timeline"/>.
/// </summary>
private class DurationVisualisation : Container private class DurationVisualisation : Container
{ {
public readonly double StartTime; public readonly double StartTime;