Refactor Skill.Process() to not require calling base.Process()

This commit is contained in:
Samuel Cattini-Schultz 2021-04-05 22:14:37 +10:00
parent 57983ae61f
commit 5bdd15f746
3 changed files with 9 additions and 8 deletions

View File

@ -70,7 +70,7 @@ namespace osu.Game.Rulesets.Difficulty
{
foreach (var skill in skills)
{
skill.Process(hitObject);
skill.ProcessInternal(hitObject);
}
}

View File

@ -30,14 +30,17 @@ namespace osu.Game.Rulesets.Difficulty.Skills
this.mods = mods;
}
internal void ProcessInternal(DifficultyHitObject current)
{
Process(current);
Previous.Push(current);
}
/// <summary>
/// Process a <see cref="DifficultyHitObject"/>.
/// </summary>
/// <param name="current">The <see cref="DifficultyHitObject"/> to process.</param>
public virtual void Process(DifficultyHitObject current)
{
Previous.Push(current);
}
protected abstract void Process(DifficultyHitObject current);
/// <summary>
/// Returns the calculated difficulty value representing all <see cref="DifficultyHitObject"/>s that have been processed up to this point.

View File

@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.Difficulty.Skills
/// <summary>
/// Process a <see cref="DifficultyHitObject"/> and update current strain values accordingly.
/// </summary>
public sealed override void Process(DifficultyHitObject current)
protected sealed override void Process(DifficultyHitObject current)
{
// The first object doesn't generate a strain, so we begin with an incremented section end
if (Previous.Count == 0)
@ -72,8 +72,6 @@ namespace osu.Game.Rulesets.Difficulty.Skills
CurrentStrain += StrainValueOf(current) * SkillMultiplier;
currentSectionPeak = Math.Max(CurrentStrain, currentSectionPeak);
base.Process(current);
}
/// <summary>