1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-24 04:43:01 +08:00
osu-lazer/osu.Game/Rulesets/Scoring/AccumulatingHealthProcessor.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
1.1 KiB
C#
Raw Normal View History

// 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.
namespace osu.Game.Rulesets.Scoring
{
2019-12-25 20:22:46 +08:00
/// <summary>
/// A <see cref="HealthProcessor"/> that accumulates health and causes a fail if the final health
/// is less than a value required to pass the beatmap.
/// </summary>
public partial class AccumulatingHealthProcessor : HealthProcessor
{
2019-12-25 20:22:46 +08:00
protected override bool DefaultFailCondition => JudgedHits == MaxHits && Health.Value < requiredHealth;
private readonly double requiredHealth;
/// <summary>
/// Creates a new <see cref="AccumulatingHealthProcessor"/>.
/// </summary>
/// <param name="requiredHealth">The minimum amount of health required to beatmap.</param>
public AccumulatingHealthProcessor(double requiredHealth)
{
2019-12-25 20:22:46 +08:00
this.requiredHealth = requiredHealth;
}
protected override void Reset(bool storeResults)
{
base.Reset(storeResults);
Health.Value = 0;
}
}
}