Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Human player = new Human();
            Bot bot = new Bot();
            Name f = new Name();
            f.ShowDialog();
            if (f.DialogResult == DialogResult.Cancel)
                return;
            if (f.DialogResult == DialogResult.OK)
                this.Visible = false;
            bot.FillField();
            this.Visible = false;

            PrepareToGame prepare = new PrepareToGame();
            prepare.ShowDialog();

            if (prepare.DialogResult == DialogResult.OK)
            {
                player = prepare.ReturnPlayer();
                player.name = f.ReturnName();
                Game game = new Game(player, bot);
                game.ShowDialog();
                if (game.DialogResult == DialogResult.Cancel)
                    Application.Exit();
                if (game.DialogResult == DialogResult.OK)
                {
                    UpdateRecords(game.ReturnWinner(), player, bot);
                }
            }
            this.Visible = true;
        }
Exemple #2
0
 public Game(Human player, Bot bot)
 {
     InitializeComponent();
     pl1 = player;
     bt = bot;
     GameWithBot = true;
 }