{\r
public ShipLabel.Fleet Fleet { get; set; }\r
public ShipLabel.Name Name { get; set; }\r
- public ShipLabel Time { get; set; }\r
+ public ShipLabel.RepairTime Time { get; set; }\r
public ShipLabel.Hp Damage { get; set; }\r
public Label BackGround { private get; set; }\r
\r
Fleet = new ShipLabel.Fleet(new Point(0, y)),\r
Name = new ShipLabel.Name(new Point(9, y)),\r
Damage = new ShipLabel.Hp {Location = new Point(119, y), Size = new Size(5, height - 1)},\r
- Time = new ShipLabel {Location = new Point(75, y), AutoSize = true},\r
+ Time = new ShipLabel.RepairTime(new Point(75, y)),\r
BackGround = new Label\r
{\r
Location = new Point(0, y - 1),\r
UseMnemonic = false;\r
}\r
\r
- public void SetRepairTime(ShipStatus status)\r
- {\r
- if (status == null)\r
- {\r
- Text = "";\r
- return;\r
- }\r
- SetRepairTime(status.RepairTime);\r
- }\r
-\r
- public void SetRepairTime(TimeSpan span)\r
- {\r
- Text = $@"{(int)span.TotalHours:d2}:{span:mm\:ss}";\r
- }\r
-\r
public new sealed class Name : ShipLabel\r
{\r
private SlotStatus _slotStatus;\r
Text = status?.Fleet == null ? "" : new[] {"1", "2", "3", "4"}[status.Fleet.Number];\r
}\r
}\r
+\r
+ public sealed class RepairTime : ShipLabel\r
+ {\r
+ public RepairTime(Point location)\r
+ {\r
+ Location = location;\r
+ AutoSize = true;\r
+ }\r
+\r
+ public void SetRepairTime(ShipStatus status)\r
+ {\r
+ if (status == null)\r
+ {\r
+ Text = "";\r
+ return;\r
+ }\r
+ SetRepairTime(status.RepairTime);\r
+ }\r
+\r
+ public void SetRepairTime(TimeSpan span)\r
+ {\r
+ Text = $@"{(int)span.TotalHours:d2}:{span:mm\:ss}";\r
+ }\r
+ }\r
}\r
}
\ No newline at end of file
\r
private class RepairLabels : ShipLabels\r
{\r
- public ShipLabel Time { get; set; }\r
+ public ShipLabel.RepairTime Time { get; set; }\r
public Label PerHp { get; set; }\r
\r
public override Control[] Controls => base.Controls.Concat(new[] {Time, PerHp}).ToArray();\r
Name = new ShipLabel.Name(new Point(10, 2)),\r
Hp = new ShipLabel.Hp(new Point(118, 0), ShipListPanel.LineHeight),\r
Level = new ShipLabel.Level(new Point(116, 2), height),\r
- Time = new ShipLabel {Location = new Point(141, 2), AutoSize = true},\r
+ Time = new ShipLabel.RepairTime(new Point(141, 2)),\r
PerHp = new Label {Location = new Point(186, 2), AutoSize = true},\r
BackPanel = new Panel\r
{\r