Make `RankFromScore()`'s dictionary param readonly

Just to make sure nobody tries any "funny" business.
This commit is contained in:
Bartłomiej Dach 2024-01-22 19:56:30 +01:00
parent 5bae9074aa
commit cb8ec48717
No known key found for this signature in database
4 changed files with 4 additions and 4 deletions

View File

@ -89,7 +89,7 @@ protected override double GetComboScoreChange(JudgementResult result)
return baseIncrease * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(combo_cap, combo_base));
}
public override ScoreRank RankFromScore(double accuracy, Dictionary<HitResult, int> results)
public override ScoreRank RankFromScore(double accuracy, IReadOnlyDictionary<HitResult, int> results)
{
if (accuracy == accuracy_cutoff_x)
return ScoreRank.X;

View File

@ -16,7 +16,7 @@ public OsuScoreProcessor()
{
}
public override ScoreRank RankFromScore(double accuracy, Dictionary<HitResult, int> results)
public override ScoreRank RankFromScore(double accuracy, IReadOnlyDictionary<HitResult, int> results)
{
ScoreRank rank = base.RankFromScore(accuracy, results);

View File

@ -35,7 +35,7 @@ protected override double GetComboScoreChange(JudgementResult result)
* strongScaleValue(result);
}
public override ScoreRank RankFromScore(double accuracy, Dictionary<HitResult, int> results)
public override ScoreRank RankFromScore(double accuracy, IReadOnlyDictionary<HitResult, int> results)
{
ScoreRank rank = base.RankFromScore(accuracy, results);

View File

@ -505,7 +505,7 @@ public void SetScoreProcessorStatistics(ScoreProcessorStatistics statistics)
/// <summary>
/// Given an accuracy (0..1), return the correct <see cref="ScoreRank"/>.
/// </summary>
public virtual ScoreRank RankFromScore(double accuracy, Dictionary<HitResult, int> results)
public virtual ScoreRank RankFromScore(double accuracy, IReadOnlyDictionary<HitResult, int> results)
{
if (accuracy == accuracy_cutoff_x)
return ScoreRank.X;