mirror of
https://github.com/ppy/osu
synced 2024-12-28 09:52:56 +00:00
Add better defaults for ControlPoint.
This commit is contained in:
parent
042aa787a5
commit
c50960af63
@ -5,17 +5,11 @@ namespace osu.Game.Beatmaps.Timing
|
||||
{
|
||||
public class ControlPoint
|
||||
{
|
||||
public static ControlPoint Default = new ControlPoint
|
||||
{
|
||||
BeatLength = 500,
|
||||
TimingChange = true,
|
||||
};
|
||||
|
||||
public TimeSignatures TimeSignature;
|
||||
public double Time;
|
||||
public double BeatLength;
|
||||
public double SpeedMultiplier;
|
||||
public bool TimingChange;
|
||||
public double BeatLength = 500;
|
||||
public double SpeedMultiplier = 1;
|
||||
public bool TimingChange = true;
|
||||
public bool KiaiMode;
|
||||
public bool OmitFirstBarLine;
|
||||
|
||||
|
@ -10,8 +10,8 @@ namespace osu.Game.Beatmaps.Timing
|
||||
{
|
||||
public readonly List<ControlPoint> ControlPoints = new List<ControlPoint>();
|
||||
|
||||
public double BPMMaximum => 60000 / (ControlPoints?.Where(c => c.BeatLength != 0).OrderBy(c => c.BeatLength).FirstOrDefault() ?? ControlPoint.Default).BeatLength;
|
||||
public double BPMMinimum => 60000 / (ControlPoints?.Where(c => c.BeatLength != 0).OrderByDescending(c => c.BeatLength).FirstOrDefault() ?? ControlPoint.Default).BeatLength;
|
||||
public double BPMMaximum => 60000 / (ControlPoints?.Where(c => c.BeatLength != 0).OrderBy(c => c.BeatLength).FirstOrDefault() ?? new ControlPoint()).BeatLength;
|
||||
public double BPMMinimum => 60000 / (ControlPoints?.Where(c => c.BeatLength != 0).OrderByDescending(c => c.BeatLength).FirstOrDefault() ?? new ControlPoint()).BeatLength;
|
||||
public double BPMMode => BPMAt(ControlPoints.Where(c => c.BeatLength != 0).GroupBy(c => c.BeatLength).OrderByDescending(grp => grp.Count()).First().First().Time);
|
||||
|
||||
public double BPMAt(double time)
|
||||
@ -74,7 +74,7 @@ namespace osu.Game.Beatmaps.Timing
|
||||
else break;
|
||||
}
|
||||
|
||||
return timingPoint ?? ControlPoint.Default;
|
||||
return timingPoint ?? new ControlPoint();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user