-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix hitobject count when creating from an IBeatmap
- Loading branch information
Showing
1 changed file
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Linq; | ||
using osu.Game.Beatmaps; | ||
using osu.Game.Online.API.Requests.Responses; | ||
using osu.Game.Rulesets.Objects.Types; | ||
|
||
namespace osu.Game.Rulesets.Scoring.Legacy | ||
{ | ||
|
@@ -44,7 +46,14 @@ public class LegacyBeatmapConversionDifficultyInfo : IBeatmapDifficultyInfo | |
|
||
public static LegacyBeatmapConversionDifficultyInfo FromAPIBeatmap(APIBeatmap apiBeatmap) => FromBeatmapInfo(apiBeatmap); | ||
|
||
public static LegacyBeatmapConversionDifficultyInfo FromBeatmap(IBeatmap beatmap) => FromBeatmapInfo(beatmap.BeatmapInfo); | ||
public static LegacyBeatmapConversionDifficultyInfo FromBeatmap(IBeatmap beatmap) => new LegacyBeatmapConversionDifficultyInfo | ||
{ | ||
SourceRuleset = beatmap.BeatmapInfo.Ruleset, | ||
CircleSize = beatmap.Difficulty.CircleSize, | ||
OverallDifficulty = beatmap.Difficulty.OverallDifficulty, | ||
CircleCount = beatmap.HitObjects.Count - beatmap.HitObjects.Count(h => h is IHasDuration), | ||
TotalObjectCount = beatmap.HitObjects.Count | ||
}; | ||
|
||
public static LegacyBeatmapConversionDifficultyInfo FromBeatmapInfo(IBeatmapInfo beatmapInfo) => new LegacyBeatmapConversionDifficultyInfo | ||
{ | ||
|