private void OnRestartClick(GameCompletedSelector ctrl) { ctrl.RestartClick -= OnRestartClick; ctrl.PlayWinnerClick -= OnPlayWinnerClick; Controls.Remove(ctrl); Initialize(); }
private void OnPlayWinnerClick(GameCompletedSelector ctrl) { ctrl.RestartClick -= OnRestartClick; ctrl.PlayWinnerClick -= OnPlayWinnerClick; Controls.Remove(ctrl); m_ComponentManager.PlayWinner = true; StartGame(); }
private void OnGameCompleted(GameViewer ctrl) { ctrl.GameCompleted -= OnGameCompleted; Controls.Remove(ctrl); Width = m_OldWidth; Height = m_OldHeight; var gameCompletedSelector = new GameCompletedSelector(); gameCompletedSelector.Dock = DockStyle.Fill; gameCompletedSelector.RestartClick += OnRestartClick; gameCompletedSelector.PlayWinnerClick += OnPlayWinnerClick; Controls.Add(gameCompletedSelector); CenterToScreen(); }