aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs
blob: a7e043f92712358d4d61df44ad34e464d4763ab2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TimeHACK.OS.Win95.Win95Apps.MineSweeper;

namespace TimeHACK.OS.Win95.Win95Apps
{
    public partial class WinClassicMinesweeper : UserControl
    {
        private Game _game;
        public int currentface = 1;
        public WinClassicMinesweeper()
        {
            InitializeComponent();
        }
        private void GameTick(object sender, EventArgs e)
        {
            labelTime.Text = _game.Time.ToString();
        }

        private void GameDismantledMinesChanged(object sender, EventArgs e)
        {
            labelBombs.Text = (_game.Mines - _game.DismantledMines).ToString();
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {
                Cursor.Current = Cursors.WaitCursor;
                _game = new Game(this.panel1, 8, 8, 10);
                _game.Tick += new EventHandler(GameTick);
                _game.DismantledMinesChanged += new EventHandler(GameDismantledMinesChanged);
                _game.Start();
        }
    }
}