mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 17:37:23 +09:00
Merge branch 'master' into screen-breadcrumbs
This commit is contained in:
commit
47cd9065bf
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Difficulty;
|
using osu.Game.Rulesets.Difficulty;
|
||||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||||
@ -49,11 +50,9 @@ namespace osu.Game.Rulesets.Mania.Difficulty
|
|||||||
|
|
||||||
int columnCount = (Beatmap as ManiaBeatmap)?.TotalColumns ?? 7;
|
int columnCount = (Beatmap as ManiaBeatmap)?.TotalColumns ?? 7;
|
||||||
|
|
||||||
foreach (var hitObject in Beatmap.HitObjects)
|
|
||||||
difficultyHitObjects.Add(new ManiaHitObjectDifficulty((ManiaHitObject)hitObject, columnCount));
|
|
||||||
|
|
||||||
// Sort DifficultyHitObjects by StartTime of the HitObjects - just to make sure.
|
// Sort DifficultyHitObjects by StartTime of the HitObjects - just to make sure.
|
||||||
difficultyHitObjects.Sort((a, b) => a.BaseHitObject.StartTime.CompareTo(b.BaseHitObject.StartTime));
|
// Note: Stable sort is done so that the ordering of hitobjects with equal start times doesn't change
|
||||||
|
difficultyHitObjects.AddRange(Beatmap.HitObjects.Select(h => new ManiaHitObjectDifficulty((ManiaHitObject)h, columnCount)).OrderBy(h => h.BaseHitObject.StartTime));
|
||||||
|
|
||||||
if (!calculateStrainValues())
|
if (!calculateStrainValues())
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -54,9 +54,11 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
base.ParseStreamInto(stream, beatmap);
|
base.ParseStreamInto(stream, beatmap);
|
||||||
|
|
||||||
// objects may be out of order *only* if a user has manually edited an .osu file.
|
// Objects may be out of order *only* if a user has manually edited an .osu file.
|
||||||
// unfortunately there are ranked maps in this state (example: https://osu.ppy.sh/s/594828).
|
// Unfortunately there are ranked maps in this state (example: https://osu.ppy.sh/s/594828).
|
||||||
this.beatmap.HitObjects.Sort((x, y) => x.StartTime.CompareTo(y.StartTime));
|
// OrderBy is used to guarantee that the parsing order of hitobjects with equal start times is maintained (stably-sorted)
|
||||||
|
// The parsing order of hitobjects matters in mania difficulty calculation
|
||||||
|
this.beatmap.HitObjects = this.beatmap.HitObjects.OrderBy(h => h.StartTime).ToList();
|
||||||
|
|
||||||
foreach (var hitObject in this.beatmap.HitObjects)
|
foreach (var hitObject in this.beatmap.HitObjects)
|
||||||
hitObject.ApplyDefaults(this.beatmap.ControlPointInfo, this.beatmap.BeatmapInfo.BaseDifficulty);
|
hitObject.ApplyDefaults(this.beatmap.ControlPointInfo, this.beatmap.BeatmapInfo.BaseDifficulty);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user