Esempio n. 1
0
        private void btnDefineWhite_Click(object sender, EventArgs e)
        {
            InviteEngine frmInviteEngine;

            if (uciEngineWhite != null && bookWhite != null)
            {
                frmInviteEngine = new InviteEngine(uciEngineWhite, bookWhite, true, this.Game);
            }
            else
            {
                frmInviteEngine = new InviteEngine(true, this.Game);
            }

            if (frmInviteEngine.ShowDialog() == DialogResult.OK)
            {
                uciEngineWhite = frmInviteEngine.SelectedEngine;
                bookWhite      = frmInviteEngine.SelectedBook;

                Ap.EngineOptions.WhiteEngine        = uciEngineWhite.EngineFile;
                Ap.EngineOptions.WhiteUseTablebases = uciEngineWhite.UseTablebases;
                Ap.EngineOptions.WhiteHashTableSize = uciEngineWhite.HashTableSize;
                Ap.EngineOptions.WhiteBook          = "";

                if (bookWhite != null)
                {
                    Ap.EngineOptions.WhiteBook = bookWhite.FilePath;
                }

                SetPlayersLabels();
            }
        }
Esempio n. 2
0
        private void btnDefineBlack_Click(object sender, EventArgs e)
        {
            InviteEngine frmInviteEngine;

            if (uciEngineBlack != null && bookBlack != null)
            {
                frmInviteEngine = new InviteEngine(uciEngineBlack, bookBlack, false, this.Game);
            }
            else
            {
                frmInviteEngine = new InviteEngine(false, this.Game);
            }

            if (frmInviteEngine.ShowDialog() == DialogResult.OK)
            {
                uciEngineBlack = frmInviteEngine.SelectedEngine;
                bookBlack      = frmInviteEngine.SelectedBook;

                Ap.EngineOptions.BlackEngine        = uciEngineBlack.EngineFile;
                Ap.EngineOptions.BlackUseTablebases = uciEngineBlack.UseTablebases;
                Ap.EngineOptions.BlackHashTableSize = uciEngineBlack.HashTableSize;
                Ap.EngineOptions.BlackBook          = "";

                if (bookBlack != null)
                {
                    Ap.EngineOptions.BlackBook = bookBlack.FilePath;
                }

                SetPlayersLabels();
            }
        }
Esempio n. 3
0
        private void btnInviteEngine_Click(object sender, EventArgs e)
        {
            InviteEngine frm = new InviteEngine(true, this.Game);

            frm.TournamentInfo = this.TournamentInfo;

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                string p = frm.SelectedEngine.EngineName.Replace(".exe", "");

                TournamentInfo.AddParticipitant(p, true);
                lstParticipent.Items.Add(p);
                lblNoOfMatches.Text = (TournamentInfo.GetNoOfMatches(lstParticipent.Items.Count) * txtCycles.Value).ToString() + " " + "Games";
                TournamentInfo.ParticipitantList.Add(p);

                if (lstParticipent.Items.Contains("Human"))
                {
                    btnNextHumanGame.Enabled = true;
                }

                if (lstParticipent.Items.Count > 1)
                {
                    btnRunContinue.Enabled = true;
                }
            }
        }
Esempio n. 4
0
        private void btnDefineEngine_Click(object sender, EventArgs e)
        {
            InviteEngine frm = new InviteEngine(selectedEngine, selectedBook, true, this.Game);

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                selectedEngine = frm.SelectedEngine;
                selectedBook   = frm.SelectedBook;
            }
        }
Esempio n. 5
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (lstParticipent.SelectedItem != null && lstParticipent.SelectedItem.ToString() != "Human")
            {
                InviteEngine frm = new InviteEngine(true, this.Game);
                frm.TournamentInfo = this.TournamentInfo;

                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    string strSelected = lstParticipent.SelectedItem.ToString();
                    int    Index       = lstParticipent.SelectedIndex;

                    string p = frm.SelectedEngine.EngineName.Replace(".exe", "");

                    TournamentInfo.UpdateParticipitant(strSelected, p);
                    TournamentInfo.ParticipitantList.Remove(strSelected);
                    lstParticipent.Items.Remove(strSelected);

                    lstParticipent.Items.Insert(Index, p);
                    TournamentInfo.ParticipitantList.Insert(Index, p);
                }
            }
        }