osu/osu.Game/Screens/Play/HUD/HealthDisplay.cs

25 lines
687 B
C#
Raw Normal View History

2018-01-05 11:21:19 +00:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
2017-03-02 09:45:20 +00:00
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2017-01-10 08:01:53 +00:00
using osu.Framework.Configuration;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Screens.Play.HUD
2017-01-10 08:01:53 +00:00
{
2017-03-10 05:42:14 +00:00
public abstract class HealthDisplay : Container
2017-01-10 08:01:53 +00:00
{
public readonly BindableDouble Current = new BindableDouble
2017-02-16 13:44:21 +00:00
{
MinValue = 0,
MaxValue = 1
};
2017-01-18 05:40:13 +00:00
2017-03-10 04:02:50 +00:00
protected HealthDisplay()
2017-01-10 08:01:53 +00:00
{
Current.ValueChanged += newValue => SetHealth((float)newValue);
2017-01-18 05:40:13 +00:00
}
2017-01-10 08:01:53 +00:00
2017-03-10 04:58:17 +00:00
protected abstract void SetHealth(float value);
2017-01-10 08:01:53 +00:00
}
}