Пример #1
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;
                }
            }
        }
Пример #2
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;
            }
        }
Пример #3
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);
                }
            }
        }