From cb8ec48717b49110bb784ae69028612d546a7a40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 22 Jan 2024 19:56:30 +0100 Subject: [PATCH] Make `RankFromScore()`'s dictionary param readonly Just to make sure nobody tries any "funny" business. --- osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs | 2 +- osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs | 2 +- osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs | 2 +- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index a12fe7f3e1..12a4182bf1 100644 --- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -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 results) + public override ScoreRank RankFromScore(double accuracy, IReadOnlyDictionary results) { if (accuracy == accuracy_cutoff_x) return ScoreRank.X; diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs index 0d62a6e718..4d8381cf42 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs @@ -16,7 +16,7 @@ public OsuScoreProcessor() { } - public override ScoreRank RankFromScore(double accuracy, Dictionary results) + public override ScoreRank RankFromScore(double accuracy, IReadOnlyDictionary results) { ScoreRank rank = base.RankFromScore(accuracy, results); diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 023cd1f902..441a53c05a 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -35,7 +35,7 @@ protected override double GetComboScoreChange(JudgementResult result) * strongScaleValue(result); } - public override ScoreRank RankFromScore(double accuracy, Dictionary results) + public override ScoreRank RankFromScore(double accuracy, IReadOnlyDictionary results) { ScoreRank rank = base.RankFromScore(accuracy, results); diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 95f672f6e6..a092829317 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -505,7 +505,7 @@ public void SetScoreProcessorStatistics(ScoreProcessorStatistics statistics) /// /// Given an accuracy (0..1), return the correct . /// - public virtual ScoreRank RankFromScore(double accuracy, Dictionary results) + public virtual ScoreRank RankFromScore(double accuracy, IReadOnlyDictionary results) { if (accuracy == accuracy_cutoff_x) return ScoreRank.X;