mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:52:53 +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>
|
/// </summary>
|
||||||
public static ScoreRank RankFromAccuracy(double accuracy)
|
public static ScoreRank RankFromAccuracy(double accuracy)
|
||||||
{
|
{
|
||||||
switch (accuracy)
|
if (accuracy == accuracy_cutoff_x)
|
||||||
{
|
return ScoreRank.X;
|
||||||
case accuracy_cutoff_x:
|
if (accuracy >= accuracy_cutoff_s)
|
||||||
return ScoreRank.X;
|
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.D;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user