1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-12 17:07:18 +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); private readonly Bindable<ScoreRank> rank = new Bindable<ScoreRank>(ScoreRank.X);
/// <remarks> /// <remarks>
/// Using the minimum accuracy as the data source to calculate the minimum rank. /// The minimum-achievable rank.
/// </remarks> /// </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> /// <remarks>
/// Using the maximum accuracy as the data source to calculate the minimum rank. /// The maximum-achievable rank.
/// </remarks> /// </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> /// <summary>
/// The highest combo achieved by this score. /// The highest combo achieved by this score.
@ -407,8 +411,8 @@ namespace osu.Game.Rulesets.Scoring
} }
rank.Value = newRank; rank.Value = newRank;
MaximumRank.Value = newMaxRank; maximumRank.Value = newMaxRank;
MinimumRank.Value = newMinRank; minimumRank.Value = newMinRank;
} }
protected virtual double ComputeTotalScore(double comboProgress, double accuracyProgress, double bonusPortion) protected virtual double ComputeTotalScore(double comboProgress, double accuracyProgress, double bonusPortion)