Ejemplo n.º 1
0
        private void MenuItem_NewGame_Click(object sender, EventArgs e)
        {
            InputForm IF = new InputForm();

            IF.ShowDialog();
            foreach (Button button in _buttonGrid) // kikapcsoljuk a gombokat
            {
                Controls.Remove(button);
            }
            MenuItem_SaveGame.Enabled = true;
            _model.NewGame(IF.ChosenMapSize, IF.ChosenMineNumber);
            GenerateTable();
            UpdateView();
        }
Ejemplo n.º 2
0
        private void GameView_Load(object sender, EventArgs e)
        {
            _dataAccess = new MineSweeperFileDataAccess();
            InputForm IF = new InputForm();

            IF.ShowDialog();
            this.AutoSize     = true;
            this.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            _model            = new GameModel(_dataAccess);
            _model.GameOver  += new EventHandler <MineSweeperEventArgs>(Game_GameOver);
            _model.NewGame(IF.ChosenMapSize, IF.ChosenMineNumber);

            GenerateTable();
            UpdateView();
        }