2017-02-07 12:59:30 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
2017-03-02 17:45:20 +08:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2017-02-07 12:59:30 +08:00
|
|
|
|
|
2017-01-10 16:01:53 +08:00
|
|
|
|
using osu.Framework.Configuration;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Modes.UI
|
|
|
|
|
{
|
2017-03-10 11:26:46 +08:00
|
|
|
|
internal abstract class HealthDisplay : Container
|
2017-01-10 16:01:53 +08:00
|
|
|
|
{
|
2017-03-10 11:26:46 +08:00
|
|
|
|
public readonly BindableDouble Current = new BindableDouble
|
2017-02-16 21:44:21 +08:00
|
|
|
|
{
|
|
|
|
|
MinValue = 0,
|
|
|
|
|
MaxValue = 1
|
|
|
|
|
};
|
2017-01-18 13:40:13 +08:00
|
|
|
|
|
2017-01-18 11:08:16 +08:00
|
|
|
|
public HealthDisplay()
|
2017-01-10 16:01:53 +08:00
|
|
|
|
{
|
2017-03-10 11:26:46 +08:00
|
|
|
|
Current.ValueChanged += (s, e) => setHP((float)Current);
|
2017-01-18 13:40:13 +08:00
|
|
|
|
}
|
2017-01-10 16:01:53 +08:00
|
|
|
|
|
2017-03-10 11:26:46 +08:00
|
|
|
|
protected abstract void setHP(float value);
|
2017-01-10 16:01:53 +08:00
|
|
|
|
}
|
|
|
|
|
}
|