diff --git a/osu.Game/Beatmaps/BeatmapDifficultyCache.cs b/osu.Game/Beatmaps/BeatmapDifficultyCache.cs index be278622b5..af1b1de0c1 100644 --- a/osu.Game/Beatmaps/BeatmapDifficultyCache.cs +++ b/osu.Game/Beatmaps/BeatmapDifficultyCache.cs @@ -16,7 +16,6 @@ using osu.Framework.Threading; using osu.Framework.Utils; using osu.Game.Database; using osu.Game.Rulesets; -using osu.Game.Rulesets.Difficulty; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.UI; @@ -344,49 +343,4 @@ namespace osu.Game.Beatmaps } } } - - public readonly struct StarDifficulty - { - /// - /// The star difficulty rating for the given beatmap. - /// - public readonly double Stars; - - /// - /// The maximum combo achievable on the given beatmap. - /// - public readonly int MaxCombo; - - /// - /// The difficulty attributes computed for the given beatmap. - /// Might not be available if the star difficulty is associated with a beatmap that's not locally available. - /// - [CanBeNull] - public readonly DifficultyAttributes Attributes; - - /// - /// Creates a structure based on computed - /// by a . - /// - public StarDifficulty([NotNull] DifficultyAttributes attributes) - { - Stars = attributes.StarRating; - MaxCombo = attributes.MaxCombo; - Attributes = attributes; - // Todo: Add more members (BeatmapInfo.DifficultyRating? Attributes? Etc...) - } - - /// - /// Creates a structure with a pre-populated star difficulty and max combo - /// in scenarios where computing is not feasible (i.e. when working with online sources). - /// - public StarDifficulty(double starDifficulty, int maxCombo) - { - Stars = starDifficulty; - MaxCombo = maxCombo; - Attributes = null; - } - - public DifficultyRating DifficultyRating => BeatmapDifficultyCache.GetDifficultyRating(Stars); - } } diff --git a/osu.Game/Beatmaps/StarDifficulty.cs b/osu.Game/Beatmaps/StarDifficulty.cs new file mode 100644 index 0000000000..f438b6f0bc --- /dev/null +++ b/osu.Game/Beatmaps/StarDifficulty.cs @@ -0,0 +1,53 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using JetBrains.Annotations; +using osu.Game.Rulesets.Difficulty; + +namespace osu.Game.Beatmaps +{ + public readonly struct StarDifficulty + { + /// + /// The star difficulty rating for the given beatmap. + /// + public readonly double Stars; + + /// + /// The maximum combo achievable on the given beatmap. + /// + public readonly int MaxCombo; + + /// + /// The difficulty attributes computed for the given beatmap. + /// Might not be available if the star difficulty is associated with a beatmap that's not locally available. + /// + [CanBeNull] + public readonly DifficultyAttributes Attributes; + + /// + /// Creates a structure based on computed + /// by a . + /// + public StarDifficulty([NotNull] DifficultyAttributes attributes) + { + Stars = attributes.StarRating; + MaxCombo = attributes.MaxCombo; + Attributes = attributes; + // Todo: Add more members (BeatmapInfo.DifficultyRating? Attributes? Etc...) + } + + /// + /// Creates a structure with a pre-populated star difficulty and max combo + /// in scenarios where computing is not feasible (i.e. when working with online sources). + /// + public StarDifficulty(double starDifficulty, int maxCombo) + { + Stars = starDifficulty; + MaxCombo = maxCombo; + Attributes = null; + } + + public DifficultyRating DifficultyRating => BeatmapDifficultyCache.GetDifficultyRating(Stars); + } +}