1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-18 11:52:54 +08:00

Remove unnecessary truncation

This commit is contained in:
Luminiscental 2022-01-04 12:30:05 +00:00
parent 75be4e83d6
commit 132079004c
No known key found for this signature in database
GPG Key ID: 855C5F980DA84332
3 changed files with 6 additions and 6 deletions

View File

@ -25,10 +25,10 @@ namespace osu.Game.Rulesets.Osu.Difficulty
public double SliderFactor { get; set; } public double SliderFactor { get; set; }
[JsonProperty("aim_difficult_strain_count")] [JsonProperty("aim_difficult_strain_count")]
public int AimDifficultStrainCount { get; set; } public double AimDifficultStrainCount { get; set; }
[JsonProperty("speed_difficult_strain_count")] [JsonProperty("speed_difficult_strain_count")]
public int SpeedDifficultStrainCount { get; set; } public double SpeedDifficultStrainCount { get; set; }
[JsonProperty("approach_rate")] [JsonProperty("approach_rate")]
public double ApproachRate { get; set; } public double ApproachRate { get; set; }

View File

@ -40,8 +40,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty
double sliderFactor = aimRating > 0 ? aimRatingNoSliders / aimRating : 1; double sliderFactor = aimRating > 0 ? aimRatingNoSliders / aimRating : 1;
int aimDifficultyStrainCount = ((OsuStrainSkill)skills[0]).CountDifficultStrains(clockRate); double aimDifficultyStrainCount = ((OsuStrainSkill)skills[0]).CountDifficultStrains(clockRate);
int speedDifficultyStrainCount = ((OsuStrainSkill)skills[2]).CountDifficultStrains(clockRate); double speedDifficultyStrainCount = ((OsuStrainSkill)skills[2]).CountDifficultStrains(clockRate);
if (mods.Any(h => h is OsuModRelax)) if (mods.Any(h => h is OsuModRelax))
speedRating = 0.0; speedRating = 0.0;

View File

@ -62,12 +62,12 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
/// Returns the number of strains above a threshold averaged as the threshold varies. /// Returns the number of strains above a threshold averaged as the threshold varies.
/// The result is scaled by clock rate as it affects the total number of strains. /// The result is scaled by clock rate as it affects the total number of strains.
/// </summary> /// </summary>
public int CountDifficultStrains(double clockRate) public double CountDifficultStrains(double clockRate)
{ {
List<double> strains = GetCurrentStrainPeaks().ToList(); List<double> strains = GetCurrentStrainPeaks().ToList();
// This is the average value of strains.Count(s => s > p * strains.Max()) for p between 0 and 1. // This is the average value of strains.Count(s => s > p * strains.Max()) for p between 0 and 1.
double realtimeCount = strains.Sum() / strains.Max(); double realtimeCount = strains.Sum() / strains.Max();
return (int)(clockRate * realtimeCount); return clockRate * realtimeCount;
} }
} }
} }