mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Add better defaults for ControlPoint.
This commit is contained in:
@ -5,17 +5,11 @@ namespace osu.Game.Beatmaps.Timing
|
|||||||
{
|
{
|
||||||
public class ControlPoint
|
public class ControlPoint
|
||||||
{
|
{
|
||||||
public static ControlPoint Default = new ControlPoint
|
|
||||||
{
|
|
||||||
BeatLength = 500,
|
|
||||||
TimingChange = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
public TimeSignatures TimeSignature;
|
public TimeSignatures TimeSignature;
|
||||||
public double Time;
|
public double Time;
|
||||||
public double BeatLength;
|
public double BeatLength = 500;
|
||||||
public double SpeedMultiplier;
|
public double SpeedMultiplier = 1;
|
||||||
public bool TimingChange;
|
public bool TimingChange = true;
|
||||||
public bool KiaiMode;
|
public bool KiaiMode;
|
||||||
public bool OmitFirstBarLine;
|
public bool OmitFirstBarLine;
|
||||||
|
|
||||||
|
@ -10,8 +10,8 @@ namespace osu.Game.Beatmaps.Timing
|
|||||||
{
|
{
|
||||||
public readonly List<ControlPoint> ControlPoints = new List<ControlPoint>();
|
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 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() ?? ControlPoint.Default).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 BPMMode => BPMAt(ControlPoints.Where(c => c.BeatLength != 0).GroupBy(c => c.BeatLength).OrderByDescending(grp => grp.Count()).First().First().Time);
|
||||||
|
|
||||||
public double BPMAt(double time)
|
public double BPMAt(double time)
|
||||||
@ -74,7 +74,7 @@ namespace osu.Game.Beatmaps.Timing
|
|||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return timingPoint ?? ControlPoint.Default;
|
return timingPoint ?? new ControlPoint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user