mirror of
https://github.com/ppy/osu
synced 2024-12-11 17:42:28 +00:00
Add IApplicableHealthProcessor
This commit is contained in:
parent
7573e316bf
commit
d7aca2f641
18
osu.Game/Rulesets/Mods/IApplicableHealthProcessor.cs
Normal file
18
osu.Game/Rulesets/Mods/IApplicableHealthProcessor.cs
Normal file
@ -0,0 +1,18 @@
|
||||
// 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 osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for a <see cref="Mod"/> that provides its own health processor.
|
||||
/// </summary>
|
||||
public interface IApplicableHealthProcessor
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates the <see cref="HealthProcessor"/>.
|
||||
/// </summary>
|
||||
HealthProcessor CreateHealthProcessor(double drainStartTime);
|
||||
}
|
||||
}
|
@ -227,7 +227,8 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
dependencies.CacheAs(ScoreProcessor);
|
||||
|
||||
HealthProcessor = ruleset.CreateHealthProcessor(playableBeatmap.HitObjects[0].StartTime);
|
||||
HealthProcessor = gameplayMods.OfType<IApplicableHealthProcessor>().FirstOrDefault()?.CreateHealthProcessor(playableBeatmap.HitObjects[0].StartTime);
|
||||
HealthProcessor ??= ruleset.CreateHealthProcessor(playableBeatmap.HitObjects[0].StartTime);
|
||||
HealthProcessor.ApplyBeatmap(playableBeatmap);
|
||||
|
||||
dependencies.CacheAs(HealthProcessor);
|
||||
|
Loading…
Reference in New Issue
Block a user