Cleanup by using const value

This commit is contained in:
Dan Balasescu 2022-06-29 16:08:59 +09:00
parent 7d743994bc
commit 34b9118fb3
2 changed files with 8 additions and 9 deletions

View File

@ -43,13 +43,6 @@ protected override double StrainValueAt(DifficultyHitObject current)
return currentStrain;
}
public override double DifficultyValue()
{
double difficulty = GetCurrentStrainPeaks().Sum();
// 1.06 comes from the default DifficultyMultiplier field in OsuStrainSkill,
// and it's added here to keep values the same after Flashlight was converted from OsuStrainSkill.
return difficulty * 1.06;
}
public override double DifficultyValue() => GetCurrentStrainPeaks().Sum() * OsuStrainSkill.DEFAULT_DIFFICULTY_MULTIPLIER;
}
}

View File

@ -14,6 +14,12 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
{
public abstract class OsuStrainSkill : StrainSkill
{
/// <summary>
/// The default multiplier applied by <see cref="OsuStrainSkill"/> to the final difficulty value after all other calculations.
/// May be overridden via <see cref="DifficultyMultiplier"/>.
/// </summary>
public const double DEFAULT_DIFFICULTY_MULTIPLIER = 1.06;
/// <summary>
/// The number of sections with the highest strains, which the peak strain reductions will apply to.
/// This is done in order to decrease their impact on the overall difficulty of the map for this skill.
@ -28,7 +34,7 @@ public abstract class OsuStrainSkill : StrainSkill
/// <summary>
/// The final multiplier to be applied to <see cref="DifficultyValue"/> after all other calculations.
/// </summary>
protected virtual double DifficultyMultiplier => 1.06;
protected virtual double DifficultyMultiplier => DEFAULT_DIFFICULTY_MULTIPLIER;
protected OsuStrainSkill(Mod[] mods)
: base(mods)