1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 16:43:00 +08:00

Use Math.Clamp

This commit is contained in:
Bartłomiej Dach 2020-08-18 19:50:16 +02:00
parent ce0e5cf9a1
commit 80e4c15727

View File

@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Skills
private double patternLengthPenalty(int patternLength)
{
double shortPatternPenalty = Math.Min(0.15 * patternLength, 1.0);
double longPatternPenalty = Math.Max(Math.Min(2.5 - 0.15 * patternLength, 1.0), 0.0);
double longPatternPenalty = Math.Clamp(2.5 - 0.15 * patternLength, 0.0, 1.0);
return Math.Min(shortPatternPenalty, longPatternPenalty);
}