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