mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 11:42:56 +08:00
Use if
statements rather than conditional case
This commit is contained in:
parent
96c1832af4
commit
1df6fc6311
@ -581,27 +581,19 @@ namespace osu.Game.Rulesets.Scoring
|
||||
/// </summary>
|
||||
public static ScoreRank RankFromAccuracy(double accuracy)
|
||||
{
|
||||
switch (accuracy)
|
||||
{
|
||||
case accuracy_cutoff_x:
|
||||
if (accuracy == accuracy_cutoff_x)
|
||||
return ScoreRank.X;
|
||||
|
||||
case >= accuracy_cutoff_s:
|
||||
if (accuracy >= accuracy_cutoff_s)
|
||||
return ScoreRank.S;
|
||||
|
||||
case >= accuracy_cutoff_a:
|
||||
if (accuracy >= accuracy_cutoff_a)
|
||||
return ScoreRank.A;
|
||||
|
||||
case >= accuracy_cutoff_b:
|
||||
if (accuracy >= accuracy_cutoff_b)
|
||||
return ScoreRank.B;
|
||||
|
||||
case >= accuracy_cutoff_c:
|
||||
if (accuracy >= accuracy_cutoff_c)
|
||||
return ScoreRank.C;
|
||||
|
||||
default:
|
||||
return ScoreRank.D;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Given a <see cref="ScoreRank"/>, return the cutoff accuracy (0..1).
|
||||
|
Loading…
Reference in New Issue
Block a user