mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 07:07:45 +08:00
Move the return value for deviation below the local functions
This commit is contained in:
parent
f8f18b6cbd
commit
2fb22f1feb
@ -129,14 +129,6 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
|
|||||||
|
|
||||||
const double z = 2.32634787404; // 99% critical value for the normal distribution (one-tailed).
|
const double z = 2.32634787404; // 99% critical value for the normal distribution (one-tailed).
|
||||||
|
|
||||||
double? deviationGreatWindow = calcDeviationGreatWindow();
|
|
||||||
double? deviationGoodWindow = calcDeviationGoodWindow();
|
|
||||||
|
|
||||||
if (deviationGreatWindow is null)
|
|
||||||
return deviationGoodWindow;
|
|
||||||
|
|
||||||
return Math.Min(deviationGreatWindow.Value, deviationGoodWindow!.Value);
|
|
||||||
|
|
||||||
// The upper bound on deviation, calculated with the ratio of 300s to objects, and the great hit window.
|
// The upper bound on deviation, calculated with the ratio of 300s to objects, and the great hit window.
|
||||||
double? calcDeviationGreatWindow()
|
double? calcDeviationGreatWindow()
|
||||||
{
|
{
|
||||||
@ -171,6 +163,14 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
|
|||||||
// We can be 99% confident that the deviation is not higher than:
|
// We can be 99% confident that the deviation is not higher than:
|
||||||
return h100 / (Math.Sqrt(2) * SpecialFunctions.ErfInv(pLowerBound));
|
return h100 / (Math.Sqrt(2) * SpecialFunctions.ErfInv(pLowerBound));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double? deviationGreatWindow = calcDeviationGreatWindow();
|
||||||
|
double? deviationGoodWindow = calcDeviationGoodWindow();
|
||||||
|
|
||||||
|
if (deviationGreatWindow is null)
|
||||||
|
return deviationGoodWindow;
|
||||||
|
|
||||||
|
return Math.Min(deviationGreatWindow.Value, deviationGoodWindow!.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int totalHits => countGreat + countOk + countMeh + countMiss;
|
private int totalHits => countGreat + countOk + countMeh + countMiss;
|
||||||
|
Loading…
Reference in New Issue
Block a user