public VisualizerForm() { startGameConfigPanel = new StartGameConfigPanel { Dock = DockStyle.Left }; startGameConfigPanel.SetMaps(MapLoader.LoadDefaultMaps().ToArray()); startGameConfigPanel.SetAis(AiFactoryRegistry.Factories); var rightPanel = new ReplayerPanel { Dock = DockStyle.Fill }; var map = startGameConfigPanel.SelectedMap.Map; UpdateMap(rightPanel); startGameConfigPanel.MapChanged += changedMap => { UpdateMap(rightPanel); }; startGameConfigPanel.AiSelected += factory => { UpdateMap(rightPanel); }; startGameConfigPanel.AiAtIndexRemoved += _ => UpdateMap(rightPanel); startGameConfigPanel.EnableFuturesChanged += _ => UpdateMap(rightPanel); startGameConfigPanel.EnableSplurgesChanged += _ => UpdateMap(rightPanel); startGameConfigPanel.EnableOptionsChanged += _ => UpdateMap(rightPanel); Controls.Add(rightPanel); Controls.Add(startGameConfigPanel); }
public ReplayerForm(ReplayRepo repo = null) { WindowState = FormWindowState.Maximized; selectReplayPanel = new SelectReplayPanel { Dock = DockStyle.Fill, Repo = repo }; var rightPanel = new ReplayerPanel { Dock = DockStyle.Fill, LiveScoreUpdate = true }; //UpdateMap(rightPanel); selectReplayPanel.ReplayChanged += () => { UpdateMap(rightPanel); }; var split = new SplitContainer() { Dock = DockStyle.Fill, //Orientation = Orientation.Vertical }; split.Panel1.Controls.Add(selectReplayPanel); split.Panel2.Controls.Add(rightPanel); split.SplitterDistance = 10; Controls.Add(split); }
private void UpdateMap(ReplayerPanel rightPanel) { var map = startGameConfigPanel.SelectedMap.Map; var settings = startGameConfigPanel.Settings; rightPanel.SetDataProvider(map, new SimulatorReplayDataProvider(startGameConfigPanel.SelectedAis, map, settings)); }
private void UpdateMap(ReplayerPanel rightPanel) { rightPanel.SetDataProvider(selectReplayPanel.SelectedReplay.Data.Map, new LogReplayDataProvider(selectReplayPanel.SelectedReplay)); }