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