<Compile Include="Log\BattleLogProcessor.cs" />\r
<Compile Include="Model\Range.cs" />\r
<Compile Include="Util\Clipboard.cs" />\r
+ <Compile Include="View\IUpdateable.cs" />\r
<Compile Include="View\UpdateContext.cs" />\r
<Compile Include="View\AntiAirPanel.cs">\r
<SubType>Component</SubType>\r
private string _debugLogFile;\r
private IEnumerator<string> _playLog;\r
private DateTime _prev, _now;\r
+ private IEnumerable<IUpdateable> _updatables;\r
\r
private readonly ErrorDialog _errorDialog = new ErrorDialog();\r
private readonly ErrorLog _errorLog;\r
panelRepairList.CreateLabels(panelRepairList_Click);\r
ndockPanel.SetClickHandler(labelNDock_Click);\r
missionPanel.SetClickHandler(labelMission_Click);\r
- SetUpdateContextToView();\r
+ SetupUpdateable();\r
PerformZoom();\r
}\r
\r
- private void SetUpdateContextToView()\r
+ private void SetupUpdateable()\r
{\r
+ _updatables = new IUpdateable[] {hqPanel, missionPanel, kdockPanel, ndockPanel};\r
var context = new UpdateContext(Sniffer, Config, new NotifySubmitter(_notificationManager), () => _now);\r
- hqPanel.Context = context;\r
- missionPanel.Context = context;\r
- kdockPanel.Context = context;\r
- ndockPanel.Context = context;\r
+ foreach (var updateable in _updatables)\r
+ updateable.Context = context;\r
}\r
\r
private void SetScaleFactorOfDpiScaling()\r
\r
private void UpdateTimers()\r
{\r
- missionPanel.UpdateTimers();\r
- ndockPanel.UpdateTimers();\r
- kdockPanel.UpdateTimers();\r
+ foreach (var updateable in _updatables)\r
+ updateable.UpdateTimers();\r
UpdateCondTimers();\r
UpdateAkashiTimer();\r
_timerEnabled = true;\r
\r
namespace KancolleSniffer.View\r
{\r
- public class HqPanel : PanelWithToolTip\r
+ public class HqPanel : PanelWithToolTip, IUpdateable\r
{\r
public Label Login { get; } = new Label\r
{\r
UpdateAchievement();\r
}\r
\r
+ public void UpdateTimers()\r
+ {\r
+ }\r
+\r
private void UpdateNumOfBuckets()\r
{\r
_numOfBuckets.Text = Context.Sniffer.Material.MaterialHistory[(int)Material.Bucket].Now.ToString("D");\r