Пример #1
0
        private void ButtonStart_Click(object sender, EventArgs e)
        {
            GameForm gameForm = new GameForm();

            gameForm.Show();
            Size size = new Size((int)NumberWidth.Value, (int)NumberHeight.Value);

            Game.Player   playerO = RadioOComputer.Checked == true ? Game.Player.Computer : Game.Player.Human;
            Game.Player   playerX = RadioXComputer.Checked == true ? Game.Player.Computer : Game.Player.Human;
            Game.Mark     starts  = RadioStartsO.Checked == true ? Game.Mark.O : (RadioStartsX.Checked == true ? Game.Mark.X : Game.Mark.None);
            Game.Openings opening = RadioClassic.Checked == true ? Game.Openings.Classic : (RadioSwap1.Checked ? Game.Openings.Swap1 : Game.Openings.Swap2);
            gameForm.InitGame(size, playerO, playerX, starts, opening, SliderODeffQ.Value, SliderXDeffQ.Value, (int)numericUpDownMoveDuration.Value);
            gameForm.FormClosed += new FormClosedEventHandler(frm_FormClosed);
            this.Hide();
        }
Пример #2
0
 public void InitGame(Size boardSize, Game.Player playerO, Game.Player playerX, Game.Mark starts, Game.Openings opening, int compODeffQ, int compXDeffQ, int moveDuration)
 {
     game = new Game(boardSize, playerO, playerX, starts, opening, compODeffQ, compXDeffQ, moveDuration);
     BoardControl.Game = game;
 }