1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-12 06:47:25 +08:00
osu-lazer/osu.Game/Screens/Play/HUD/HealthDisplay.cs

37 lines
1.2 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.
2018-04-13 17:19:50 +08:00
2019-02-21 18:04:31 +08:00
using osu.Framework.Bindables;
2018-04-13 17:19:50 +08:00
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Scoring;
2020-03-18 15:17:41 +08:00
using osu.Game.Rulesets.UI;
2018-04-13 17:19:50 +08:00
namespace osu.Game.Screens.Play.HUD
{
2020-03-18 15:17:41 +08:00
/// <summary>
/// A container for components displaying the current player health.
/// Gets bound automatically to the <see cref="HealthProcessor"/> when inserted to <see cref="DrawableRuleset.Overlays"/> hierarchy.
/// </summary>
public abstract class HealthDisplay : Container, IHealthDisplay
2018-04-13 17:19:50 +08:00
{
public Bindable<double> Current { get; } = new BindableDouble(1)
2018-04-13 17:19:50 +08:00
{
MinValue = 0,
MaxValue = 1
};
2020-03-18 15:17:41 +08:00
public virtual void Flash(JudgementResult result)
{
}
2020-03-18 15:17:41 +08:00
/// <summary>
/// Bind the tracked fields of <see cref="HealthProcessor"/> to this health display.
/// </summary>
2020-04-09 13:31:25 +08:00
public virtual void BindHealthProcessor(HealthProcessor processor)
{
Current.BindTo(processor.Health);
}
2018-04-13 17:19:50 +08:00
}
}