mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Merge branch 'master' into editor-timing-screen
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osuTK;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Beatmaps.Timing;
|
||||
|
||||
namespace osu.Game.Beatmaps.ControlPoints
|
||||
@ -11,17 +11,35 @@ namespace osu.Game.Beatmaps.ControlPoints
|
||||
/// <summary>
|
||||
/// The time signature at this control point.
|
||||
/// </summary>
|
||||
public TimeSignatures TimeSignature = TimeSignatures.SimpleQuadruple;
|
||||
public readonly Bindable<TimeSignatures> TimeSignatureBindable = new Bindable<TimeSignatures>(TimeSignatures.SimpleQuadruple) { Default = TimeSignatures.SimpleQuadruple };
|
||||
|
||||
/// <summary>
|
||||
/// The time signature at this control point.
|
||||
/// </summary>
|
||||
public TimeSignatures TimeSignature
|
||||
{
|
||||
get => TimeSignatureBindable.Value;
|
||||
set => TimeSignatureBindable.Value = value;
|
||||
}
|
||||
|
||||
public const double DEFAULT_BEAT_LENGTH = 1000;
|
||||
|
||||
/// <summary>
|
||||
/// The beat length at this control point.
|
||||
/// </summary>
|
||||
public virtual double BeatLength
|
||||
public readonly BindableDouble BeatLengthBindable = new BindableDouble(DEFAULT_BEAT_LENGTH)
|
||||
{
|
||||
get => beatLength;
|
||||
set => beatLength = MathHelper.Clamp(value, 6, 60000);
|
||||
Default = DEFAULT_BEAT_LENGTH,
|
||||
MinValue = 6,
|
||||
MaxValue = 60000
|
||||
};
|
||||
|
||||
/// The beat length at this control point.
|
||||
/// </summary>
|
||||
public double BeatLength
|
||||
{
|
||||
get => BeatLengthBindable.Value;
|
||||
set => BeatLengthBindable.Value = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -29,10 +47,8 @@ namespace osu.Game.Beatmaps.ControlPoints
|
||||
/// </summary>
|
||||
public double BPM => 60000 / BeatLength;
|
||||
|
||||
private double beatLength = DEFAULT_BEAT_LENGTH;
|
||||
|
||||
public override bool EquivalentTo(ControlPoint other) =>
|
||||
other is TimingControlPoint otherTyped
|
||||
&& TimeSignature == otherTyped.TimeSignature && beatLength.Equals(otherTyped.beatLength);
|
||||
&& TimeSignature == otherTyped.TimeSignature && BeatLength.Equals(otherTyped.BeatLength);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user