forked from ppy/osu
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ppy#30322 from smoogipoo/bat-max-performance
Implement "max pp" beatmap difficulty attribute text
- Loading branch information
Showing
9 changed files
with
157 additions
and
150 deletions.
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
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
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,9 +1,6 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using JetBrains.Annotations; | ||
using osu.Framework.Utils; | ||
using osu.Game.Rulesets.Difficulty; | ||
|
||
|
@@ -25,30 +22,34 @@ public readonly struct StarDifficulty | |
/// 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. | ||
/// </summary> | ||
[CanBeNull] | ||
public readonly DifficultyAttributes Attributes; | ||
public readonly DifficultyAttributes? DifficultyAttributes; | ||
|
||
/// <summary> | ||
/// The performance attributes computed for a perfect score on the given beatmap. | ||
/// Might not be available if the star difficulty is associated with a beatmap that's not locally available. | ||
/// </summary> | ||
public readonly PerformanceAttributes? PerformanceAttributes; | ||
|
||
/// <summary> | ||
/// Creates a <see cref="StarDifficulty"/> structure based on <see cref="DifficultyAttributes"/> computed | ||
/// by a <see cref="DifficultyCalculator"/>. | ||
/// Creates a <see cref="StarDifficulty"/> structure. | ||
/// </summary> | ||
public StarDifficulty([NotNull] DifficultyAttributes attributes) | ||
public StarDifficulty(DifficultyAttributes difficulty, PerformanceAttributes performance) | ||
{ | ||
Stars = double.IsFinite(attributes.StarRating) ? attributes.StarRating : 0; | ||
MaxCombo = attributes.MaxCombo; | ||
Attributes = attributes; | ||
Stars = double.IsFinite(difficulty.StarRating) ? difficulty.StarRating : 0; | ||
MaxCombo = difficulty.MaxCombo; | ||
DifficultyAttributes = difficulty; | ||
PerformanceAttributes = performance; | ||
// Todo: Add more members (BeatmapInfo.DifficultyRating? Attributes? Etc...) | ||
} | ||
|
||
/// <summary> | ||
/// Creates a <see cref="StarDifficulty"/> structure with a pre-populated star difficulty and max combo | ||
/// in scenarios where computing <see cref="DifficultyAttributes"/> is not feasible (i.e. when working with online sources). | ||
/// in scenarios where computing <see cref="Rulesets.Difficulty.DifficultyAttributes"/> is not feasible (i.e. when working with online sources). | ||
/// </summary> | ||
public StarDifficulty(double starDifficulty, int maxCombo) | ||
{ | ||
Stars = double.IsFinite(starDifficulty) ? starDifficulty : 0; | ||
MaxCombo = maxCombo; | ||
Attributes = null; | ||
} | ||
|
||
public DifficultyRating DifficultyRating => GetDifficultyRating(Stars); | ||
|
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
121 changes: 0 additions & 121 deletions
121
osu.Game/Rulesets/Difficulty/PerformanceBreakdownCalculator.cs
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.