mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 17:53:53 +08:00
Use Math.Clamp
This commit is contained in:
parent
ce0e5cf9a1
commit
80e4c15727
@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Skills
|
|||||||
private double patternLengthPenalty(int patternLength)
|
private double patternLengthPenalty(int patternLength)
|
||||||
{
|
{
|
||||||
double shortPatternPenalty = Math.Min(0.15 * patternLength, 1.0);
|
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);
|
return Math.Min(shortPatternPenalty, longPatternPenalty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user