Esempio n. 1
0
        public void AddKibitzerPanel(AnalysisUc analysisUc)
        {
            if (dp.InvokeRequired)
            {
                dp.BeginInvoke(new MethodInvoker(delegate() { AddKibitzerPanel(analysisUc); }));
            }
            else
            {
                analysisUc.TabText = analysisUc.UCIEngine.Id;

                if (KibitzerManager.KibitzersList.Count == 1)
                {
                    //analysisUc.Show(ChessBoard.Pane, DockAlignment.Bottom, 0.25);
                    analysisUc.Show(dp, DockState.DockBottom);
                }
                else
                {
                    AnalysisUc parent = KibitzerManager.KibitzersList[0];
                    analysisUc.Show(parent.Pane, null);
                }
            }
        }
        protected override void LoadPanels()
        {
            #region Load from xml

            string fileName = Ap.FileDock(base.Game.GameMode);
            if (LoadFromFile(fileName))
            {
                return;
            }

            string defaultFileName = Ap.FileDockDefault(base.Game.GameMode);
            if (LoadFromFile(defaultFileName) && base.Game.GameMode == GameMode.EngineVsEngine)
            {
                return;
            }
            #endregion

            #region Load Manually

            ChessBoard.Show(dp, DockState.Document);

            if (Config.IsDev)
            {
                DevUc.Show(ChessBoard.Pane, null);
            }

            ClockUc.Show(dp, DockState.DockRight);

            GameInfoUc.Visible                    = Ap.Options.ShowGameInfo;
            CapturePieceUc.Visible                = Ap.Options.ShowCapturedPieces;
            gameInfoToolStripMenuItem.Checked     = Ap.Options.ShowGameInfo;
            capturePieceToolStripMenuItem.Checked = Ap.Options.ShowCapturedPieces;

            if (base.Game.GameMode == GameMode.EngineVsEngine)
            {
                //NotationUc.Show(ChessBoard.Pane, DockAlignment.Bottom, 0.70);
                NotationUc.Show(dp, DockState.DockBottom);
            }
            else
            {
                NotationUc.Show(ClockUc.Pane, DockAlignment.Bottom, 0.85);
                ScoringUc.Show(NotationUc.Pane, null);
                BookUc.Show(NotationUc.Pane, null);
            }

            switch (base.Game.GameMode)
            {
            case GameMode.None:
                break;

            case GameMode.HumanVsHuman:
                break;

            case GameMode.HumanVsEngine:
                AnalysisUc.Show(NotationUc.Pane, DockAlignment.Bottom, 0.40);
                break;

            case GameMode.EngineVsEngine:
                base.AnalysisUc1.SetEngine(base.Game.Player1.Engine);
                AnalysisUc1.Show(ClockUc.Pane, DockAlignment.Bottom, 0.40);

                base.AnalysisUc2.SetEngine(base.Game.Player2.Engine);
                AnalysisUc2.Show(AnalysisUc1.Pane, DockAlignment.Bottom, 0.45);
                break;
            }

            #endregion
        }