1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 23:42:55 +08:00

Apply code style changes

This commit is contained in:
Dean Herbert 2022-01-29 13:47:04 +09:00
parent a4aa501bb5
commit c75ffe9b07

View File

@ -43,7 +43,8 @@ namespace osu.Game.Rulesets.Mania.Mods
var maniaBeatmap = (ManiaBeatmap)beatmap; var maniaBeatmap = (ManiaBeatmap)beatmap;
var newObjects = new List<ManiaHitObject>(); var newObjects = new List<ManiaHitObject>();
var beatSnap = 1/(Math.Pow(2, (double)MinBeatSnap.Value)); double beatSnap = 1 / (Math.Pow(2, (double)MinBeatSnap.Value));
foreach (var h in beatmap.HitObjects.OfType<HoldNote>()) foreach (var h in beatmap.HitObjects.OfType<HoldNote>())
{ {
// Add a note for the beginning of the hold note // Add a note for the beginning of the hold note
@ -55,7 +56,8 @@ namespace osu.Game.Rulesets.Mania.Mods
}); });
// Don't add an end note if the duration is shorter than some threshold, or end notes are disabled // Don't add an end note if the duration is shorter than some threshold, or end notes are disabled
var noteValue = getNoteValue(h, maniaBeatmap); // 1/1, 1/2, 1/4, etc. double noteValue = getNoteValue(h, maniaBeatmap); // 1/1, 1/2, 1/4, etc.
if (AddEndNotes.Value && noteValue >= beatSnap) if (AddEndNotes.Value && noteValue >= beatSnap)
{ {
newObjects.Add(new Note newObjects.Add(new Note
@ -66,13 +68,14 @@ namespace osu.Game.Rulesets.Mania.Mods
}); });
} }
} }
maniaBeatmap.HitObjects = maniaBeatmap.HitObjects.OfType<Note>().Concat(newObjects).OrderBy(h => h.StartTime).ToList(); maniaBeatmap.HitObjects = maniaBeatmap.HitObjects.OfType<Note>().Concat(newObjects).OrderBy(h => h.StartTime).ToList();
} }
public static double getNoteValue(HoldNote holdNote, ManiaBeatmap beatmap) { private static double getNoteValue(HoldNote holdNote, ManiaBeatmap beatmap)
var bpmAtNoteTime = beatmap.ControlPointInfo.TimingPointAt(holdNote.StartTime).BPM; {
var noteValue = (60*holdNote.Duration)/(1000*bpmAtNoteTime); double bpmAtNoteTime = beatmap.ControlPointInfo.TimingPointAt(holdNote.StartTime).BPM;
return noteValue; return (60 * holdNote.Duration) / (1000 * bpmAtNoteTime);
} }
public enum BeatDivisors public enum BeatDivisors