Update with PopulateAttributes() removal

This commit is contained in:
smoogipoo 2019-02-19 17:45:16 +09:00
parent 6433ecf6aa
commit 0ef15f5bd5
2 changed files with 15 additions and 13 deletions

View File

@ -11,8 +11,8 @@ public class TaikoDifficultyHitObject : DifficultyHitObject
{
public readonly bool HasTypeChange;
public TaikoDifficultyHitObject(HitObject hitObject, HitObject lastObject, double timeRate)
: base(hitObject, lastObject, timeRate)
public TaikoDifficultyHitObject(HitObject hitObject, HitObject lastObject, double clockRate)
: base(hitObject, lastObject, clockRate)
{
HasTypeChange = lastObject is RimHit != hitObject is RimHit;
}

View File

@ -24,27 +24,29 @@ public TaikoDifficultyCalculator(Ruleset ruleset, WorkingBeatmap beatmap)
{
}
protected override void PopulateAttributes(DifficultyAttributes attributes, IBeatmap beatmap, Skill[] skills, double timeRate)
protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate)
{
var taikoAttributes = (TaikoDifficultyAttributes)attributes;
if (beatmap.HitObjects.Count == 0)
return new TaikoDifficultyAttributes();
taikoAttributes.StarRating = skills.Single().DifficultyValue() * star_scaling_factor;
// Todo: This int cast is temporary to achieve 1:1 results with osu!stable, and should be removed in the future
taikoAttributes.GreatHitWindow = (int)(beatmap.HitObjects.First().HitWindows.Great / 2) / timeRate;
taikoAttributes.MaxCombo = beatmap.HitObjects.Count(h => h is Hit);
return new TaikoDifficultyAttributes
{
StarRating = skills.Single().DifficultyValue() * star_scaling_factor,
Mods = mods,
// Todo: This int cast is temporary to achieve 1:1 results with osu!stable, and should be removed in the future
GreatHitWindow = (int)(beatmap.HitObjects.First().HitWindows.Great / 2) / clockRate,
MaxCombo = beatmap.HitObjects.Count(h => h is Hit),
};
}
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double timeRate)
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate)
{
for (int i = 1; i < beatmap.HitObjects.Count; i++)
yield return new TaikoDifficultyHitObject(beatmap.HitObjects[i], beatmap.HitObjects[i - 1], timeRate);
yield return new TaikoDifficultyHitObject(beatmap.HitObjects[i], beatmap.HitObjects[i - 1], clockRate);
}
protected override Skill[] CreateSkills() => new Skill[] { new Strain() };
protected override DifficultyAttributes CreateDifficultyAttributes() => new TaikoDifficultyAttributes();
protected override Mod[] DifficultyAdjustmentMods => new Mod[]
{
new TaikoModDoubleTime(),