mirror of
https://github.com/ppy/osu.git
synced 2026-05-21 00:20:25 +08:00
fadb1c3f2c
This change removes `clockRate` precalculation from `DifficultyCalculator`. The idea is that clock rate should be calculated in-place (ideally for every object) since we store and access it using DHOs. This also prevents anyone from accidentally passing clock rate to skills Unfortunately osu uses clock rate to calculate OD for the whole map in `CreateDifficultyAttributes` so we can't make it completely DHO-based, but I think one single in-place call to `ModUtils.CalculateRateWithMods` in `CreateDifficultyAttributes` is fine --------- Co-authored-by: James Wilson <tsunyoku@gmail.com>
32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using osu.Game.Beatmaps;
|
|
using osu.Game.Rulesets.Difficulty;
|
|
using osu.Game.Rulesets.Difficulty.Preprocessing;
|
|
using osu.Game.Rulesets.Difficulty.Skills;
|
|
using osu.Game.Rulesets.Mods;
|
|
|
|
namespace osu.Game.Rulesets.EmptyFreeform
|
|
{
|
|
public class EmptyFreeformDifficultyCalculator : DifficultyCalculator
|
|
{
|
|
public EmptyFreeformDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap beatmap)
|
|
: base(ruleset, beatmap)
|
|
{
|
|
}
|
|
|
|
protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills)
|
|
{
|
|
return new DifficultyAttributes(mods, 0);
|
|
}
|
|
|
|
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, Mod[] mods) => Enumerable.Empty<DifficultyHitObject>();
|
|
|
|
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods) => Array.Empty<Skill>();
|
|
}
|
|
}
|