From ff35f6a1dafdf1772a355690fe7251b121b43b60 Mon Sep 17 00:00:00 2001 From: DavidBeh <67109172+DavidBeh@users.noreply.github.com> Date: Sun, 1 Dec 2024 01:56:31 +0100 Subject: [PATCH] added documentation --- osu.Game/Rulesets/Mods/ModHidden.cs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModHidden.cs b/osu.Game/Rulesets/Mods/ModHidden.cs index f1e14f2b3fc3..d584de8c52d4 100644 --- a/osu.Game/Rulesets/Mods/ModHidden.cs +++ b/osu.Game/Rulesets/Mods/ModHidden.cs @@ -75,10 +75,6 @@ void ScoreProcessorOnNewJudgement(JudgementResult judgement, bool revert = false _combo = ComputeNewComboValue(_combo, judgement); if (oldCombo == _combo) return; - else - { - - } uint comboValue = GetHiddenComboInfluence(judgement); if (comboValue == 0) return; _combo = !judgement.IsHit ? 0 : _combo + comboValue; @@ -97,14 +93,23 @@ void ScoreProcessorOnNewJudgement(JudgementResult judgement, bool revert = false } } - protected float GetAndUpdateDrawableHitObjectComboAlpha(DrawableHitObject dho, bool? hasStarted = null) + /// + /// Gets the alpha value for a hit object based on the current combo. And stores it internally. + /// Hitobjects that have already started will never have this value decreased. + /// + /// + /// An optional to use instead of computing it from drawableHitObject. + /// The default can handle objects implementing IHasTimePreempt. + /// + /// + protected float GetAndUpdateDrawableHitObjectComboAlpha(DrawableHitObject drawableHitObject, bool? hasStarted = null) { if (EnableAtCombo.Value == 0) return 0; - HitObject? ho = dho.HitObject; + HitObject? ho = drawableHitObject.HitObject; - hasStarted ??= ho.StartTime - ((ho as IHasTimePreempt)?.TimePreempt ?? 0) < dho.Time.Current; + hasStarted ??= ho.StartTime - ((ho as IHasTimePreempt)?.TimePreempt ?? 0) < drawableHitObject.Time.Current; - if (_opacityTable.TryGetValue(dho.HitObject, out float alpha)) + if (_opacityTable.TryGetValue(drawableHitObject.HitObject, out float alpha)) { if (_alpha > alpha || !hasStarted.Value) {