mirror of
https://github.com/ppy/osu
synced 2024-12-27 01:12:45 +00:00
Refactor Skill.Process() to not require calling base.Process()
This commit is contained in:
parent
57983ae61f
commit
5bdd15f746
@ -70,7 +70,7 @@ namespace osu.Game.Rulesets.Difficulty
|
||||
{
|
||||
foreach (var skill in skills)
|
||||
{
|
||||
skill.Process(hitObject);
|
||||
skill.ProcessInternal(hitObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user