mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 18:23:04 +08:00
Remove PopulateAttributes()
This commit is contained in:
parent
2bf5534bf1
commit
ca8b7f24b4
@ -25,14 +25,12 @@ namespace osu.Game.Rulesets.Difficulty
|
|||||||
|
|
||||||
protected override DifficultyAttributes Calculate(IBeatmap beatmap, Mod[] mods, double clockRate)
|
protected override DifficultyAttributes Calculate(IBeatmap beatmap, Mod[] mods, double clockRate)
|
||||||
{
|
{
|
||||||
var attributes = CreateDifficultyAttributes();
|
var skills = CreateSkills();
|
||||||
attributes.Mods = mods;
|
|
||||||
|
|
||||||
if (!beatmap.HitObjects.Any())
|
if (!beatmap.HitObjects.Any())
|
||||||
return attributes;
|
return CreateDifficultyAttributes(beatmap, mods, skills, clockRate);
|
||||||
|
|
||||||
var difficultyHitObjects = CreateDifficultyHitObjects(beatmap, clockRate).OrderBy(h => h.BaseObject.StartTime).ToList();
|
var difficultyHitObjects = CreateDifficultyHitObjects(beatmap, clockRate).OrderBy(h => h.BaseObject.StartTime).ToList();
|
||||||
var skills = CreateSkills();
|
|
||||||
|
|
||||||
double sectionLength = SectionLength * clockRate;
|
double sectionLength = SectionLength * clockRate;
|
||||||
|
|
||||||
@ -60,9 +58,7 @@ namespace osu.Game.Rulesets.Difficulty
|
|||||||
foreach (Skill s in skills)
|
foreach (Skill s in skills)
|
||||||
s.SaveCurrentPeak();
|
s.SaveCurrentPeak();
|
||||||
|
|
||||||
PopulateAttributes(attributes, beatmap, skills, clockRate);
|
return CreateDifficultyAttributes(beatmap, mods, skills, clockRate);
|
||||||
|
|
||||||
return attributes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -108,13 +104,13 @@ namespace osu.Game.Rulesets.Difficulty
|
|||||||
protected virtual Mod[] DifficultyAdjustmentMods => Array.Empty<Mod>();
|
protected virtual Mod[] DifficultyAdjustmentMods => Array.Empty<Mod>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Populates <see cref="DifficultyAttributes"/> after difficulty has been processed.
|
/// Creates <see cref="DifficultyAttributes"/> to describe beatmap's calculated difficulty.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="attributes">The <see cref="DifficultyAttributes"/> to populate with information about the difficulty of <paramref name="beatmap"/>.</param>
|
|
||||||
/// <param name="beatmap">The <see cref="IBeatmap"/> whose difficulty was processed.</param>
|
/// <param name="beatmap">The <see cref="IBeatmap"/> whose difficulty was processed.</param>
|
||||||
|
/// <param name="mods">The <see cref="Mod"/>s that were applied during the process.</param>
|
||||||
/// <param name="skills">The skills which processed the difficulty.</param>
|
/// <param name="skills">The skills which processed the difficulty.</param>
|
||||||
/// <param name="clockRate">The rate at which the gameplay clock is run at.</param>
|
/// <param name="clockRate">The rate at which the gameplay clock is run at.</param>
|
||||||
protected abstract void PopulateAttributes(DifficultyAttributes attributes, IBeatmap beatmap, Skill[] skills, double clockRate);
|
protected abstract DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enumerates <see cref="DifficultyHitObject"/>s to be processed from <see cref="HitObject"/>s in the <see cref="IBeatmap"/>.
|
/// Enumerates <see cref="DifficultyHitObject"/>s to be processed from <see cref="HitObject"/>s in the <see cref="IBeatmap"/>.
|
||||||
@ -129,11 +125,5 @@ namespace osu.Game.Rulesets.Difficulty
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The <see cref="Skill"/>s.</returns>
|
/// <returns>The <see cref="Skill"/>s.</returns>
|
||||||
protected abstract Skill[] CreateSkills();
|
protected abstract Skill[] CreateSkills();
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates an empty <see cref="DifficultyAttributes"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>The empty <see cref="DifficultyAttributes"/>.</returns>
|
|
||||||
protected abstract DifficultyAttributes CreateDifficultyAttributes();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user