public abstract class ShipLabel : GrowLeftLabel\r
{\r
protected Color InitialBackColor;\r
- protected ShipStatus Status;\r
\r
protected Font BaseFont => Parent.Font;\r
\r
public sealed class Hp : ShipLabel\r
{\r
private bool _hpPercent;\r
+ private ShipStatus _status;\r
\r
public Hp()\r
{\r
\r
public override void Reset()\r
{\r
+ _status = null;\r
Text = "";\r
BackColor = InitialBackColor;\r
}\r
\r
public override void Set(ShipStatus status)\r
{\r
- Status = status;\r
+ _status = status;\r
Font = BaseFont;\r
Text = _hpPercent\r
? $"{(int)Floor(status.NowHp * 100.0 / status.MaxHp):D}%"\r
public void ToggleHpPercent()\r
{\r
_hpPercent = !_hpPercent;\r
- if (Status != null)\r
- Set(Status);\r
+ if (_status != null)\r
+ Set(_status);\r
}\r
\r
public void SetHp(int now, int max)\r