Refactor code regarding hidden boolean

This commit is contained in:
MBmasher 2021-12-21 20:58:05 +11:00
parent c5de203aa5
commit 2aafcd3628

View File

@ -19,8 +19,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
public Flashlight(Mod[] mods) public Flashlight(Mod[] mods)
: base(mods) : base(mods)
{ {
this.mods = mods; hidden = mods.Any(m => m is OsuModHidden);
this.hidden = mods.Any(m => m is OsuModHidden);
} }
private double skillMultiplier => 0.05; private double skillMultiplier => 0.05;
@ -28,8 +27,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
protected override double DecayWeight => 1.0; protected override double DecayWeight => 1.0;
protected override int HistoryLength => 10; // Look back for 10 notes is added for the sake of flashlight calculations. protected override int HistoryLength => 10; // Look back for 10 notes is added for the sake of flashlight calculations.
private readonly Mod[] mods; private readonly bool hidden;
private bool hidden;
private const double max_opacity_bonus = 0.4; private const double max_opacity_bonus = 0.4;
private const double hidden_bonus = 0.2; private const double hidden_bonus = 0.2;