1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-11 15:27:20 +08:00

Make the min, max rank property to IBindable, so that they can't modify from outside

This commit is contained in:
normalid 2024-07-04 14:50:57 +08:00
parent 2971065e88
commit 92e53fac28

View File

@ -99,14 +99,18 @@ namespace osu.Game.Rulesets.Scoring
private readonly Bindable<ScoreRank> rank = new Bindable<ScoreRank>(ScoreRank.X);
/// <remarks>
/// Using the minimum accuracy as the data source to calculate the minimum rank.
/// The minimum-achievable rank.
/// </remarks>
public readonly Bindable<ScoreRank> MinimumRank = new Bindable<ScoreRank>(ScoreRank.X);
public IBindable<ScoreRank> MinimumRank => minimumRank;
private readonly Bindable<ScoreRank> minimumRank = new Bindable<ScoreRank>(ScoreRank.D);
/// <remarks>
/// Using the maximum accuracy as the data source to calculate the minimum rank.
/// The maximum-achievable rank.
/// </remarks>
public readonly Bindable<ScoreRank> MaximumRank = new Bindable<ScoreRank>(ScoreRank.X);
public IBindable<ScoreRank> MaximumRank => maximumRank;
private readonly Bindable<ScoreRank> maximumRank = new Bindable<ScoreRank>(ScoreRank.X);
/// <summary>
/// The highest combo achieved by this score.
@ -407,8 +411,8 @@ namespace osu.Game.Rulesets.Scoring
}
rank.Value = newRank;
MaximumRank.Value = newMaxRank;
MinimumRank.Value = newMinRank;
maximumRank.Value = newMaxRank;
minimumRank.Value = newMinRank;
}
protected virtual double ComputeTotalScore(double comboProgress, double accuracyProgress, double bonusPortion)