Split ControlPoint into different types.

# Conflicts:
#	osu.Game.Rulesets.Mania/UI/Column.cs
This commit is contained in:
smoogipooo
2017-05-23 13:55:18 +09:00
parent d1eb8937b7
commit 3cdfd2eef5
38 changed files with 307 additions and 205 deletions

View File

@ -8,6 +8,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using OpenTK;
using osu.Game.Beatmaps.Timing;
using osu.Game.Beatmaps.ControlPoints;
namespace osu.Game.Rulesets.Mania.Timing
{
@ -26,9 +27,9 @@ namespace osu.Game.Rulesets.Mania.Timing
/// </summary>
public double TimeSpan { get; set; }
private readonly List<DrawableControlPoint> drawableControlPoints;
private readonly List<DrawableControlPoint> drawableControlPoints = new List<DrawableControlPoint>();
public ControlPointContainer(IEnumerable<ControlPoint> timingChanges)
public ControlPointContainer(IEnumerable<TimingChange> timingChanges)
{
drawableControlPoints = timingChanges.Select(t => new DrawableControlPoint(t)).ToList();
Children = drawableControlPoints;
@ -64,7 +65,7 @@ namespace osu.Game.Rulesets.Mania.Timing
/// </summary>
private class DrawableControlPoint : Container
{
private readonly ControlPoint timingChange;
private readonly TimingChange timingChange;
protected override Container<Drawable> Content => content;
private readonly Container content;
@ -76,7 +77,7 @@ namespace osu.Game.Rulesets.Mania.Timing
/// the content container will scroll at twice the normal rate.
/// </summary>
/// <param name="timingChange">The control point to create the drawable control point for.</param>
public DrawableControlPoint(ControlPoint timingChange)
public DrawableControlPoint(TimingChange timingChange)
{
this.timingChange = timingChange;

View File

@ -0,0 +1,23 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Rulesets.Mania.Timing
{
public class TimingChange
{
/// <summary>
/// The time at which this timing change happened.
/// </summary>
public double Time;
/// <summary>
/// The beat length.
/// </summary>
public double BeatLength = 500;
/// <summary>
/// The speed multiplier.
/// </summary>
public double SpeedMultiplier = 1;
}
}